pic1 = double (Pic1);
pic2 = double(Pic2);
pic3 = double(Pic3);
pic4 = double(Pic4);
ILB = 1;
B = pic1./ILB;
ILC = 0.2;
VC(1:1024,1:1024)= 0.581695;
VT = 0.025;
C = (pic2 - B*ILC)./(exp(VC./VT))
IL = 1;
V1 = VT*log((pic3 - B*IL)./(C));
V2 = VT*log((pic4 - B*IL)./(C));
Vapp1(1:1024,1:1024)=0.616185;
Vapp2(1:1024,1:1024)=0.575044;
jp = input('Please enter the jp value ranging between 36 to 40 mA/cm^2: ');
if jp >0
R =(((Vapp2-V2).*exp(V1./VT))-((Vapp1-V1).*exp(V2./VT)))./(jp.*(exp(V2./VT)-exp(V1./VT)))
imagesc(R)
j0 = ((Vapp2-V2-Vapp1+V1).*(jp))./(exp(V1./VT).*(Vapp1-V2)-exp(V2./VT).*(Vapp1-V1));
figure;
imagesc(j0)
end
我想将工作空间中显示的R和J0数据值分别导出到excel文件或txt中。文件。这样做的编码是什么?
答案 0 :(得分:1)
如http://www.mathworks.com/help/matlab/ref/csvwrite.html?requestedDomain=www.mathworks.com中所述,您可以使用csvwrite(filename,M)
将变量导出到csv文件。然后你只需要在Excel中导入文件。
尝试:
csvwrite('R_var.csv', R);
csvwrite('j0_var.csv', j0);