查看完整版本 : [求助]matlab excel
請問各位要怎麼把matlab裡的數值 匯入excel? 我想把它繪成圖表
l1=10;
l2=4;
fprintf(' e e2 Ax Ay \n')
fprintf(' ---------- ---------- --------- ---------- \n')
for i = 1:10
e=120+i*2;
e2=30+i*4;
Ax = l1*cosd(e)-l2*cosd(e2);
Ay = l1*sind(e)+l2*sind(e2);
fprintf('%11.f %11.f %12.3f %12.3f \n',e,e2, Ax, Ay)
end;:cry:
mtseasky
2008-08-05, 03:50
fid01 = fopen('output.xls','w');
l1=10;
l2=4;
fprintf(fid01,'e\t e2\t Ax\t Ay\n'); %第一行
for i = 1:10
e=120+i*2;
e2=30+i*4;
Ax = l1*cosd(e)-l2*cosd(e2);
Ay = l1*sind(e)+l2*sind(e2);
fprintf(fid01,'%f\t %f\t %f\t %f\n',e,e2, Ax, Ay);
end;
fclose(fid01);
mathjiang
2008-08-06, 12:10
偶也学到了,谢谢楼上坛友!!
好厲害唷,果真高手雲集,要跟你們督多學習:lovely:
mtseasky
2008-08-07, 22:06
也只是新手而已
一起学习了
mtseasky
2008-08-11, 22:14
%指定excel的页面Sheet2
Row1={'e','e2','Ax','Ay'};
xlswrite('xlsoutput.xls', Row1, 'Sheet2','A1');
l1=10;
l2=4;
for i = 1:10
e=120+i*2;
e2=30+i*4;
Ax = l1*cosd(e)-l2*cosd(e2);
Ay = l1*sind(e)+l2*sind(e2);
M(i,:)=[e e2 Ax Ay];
end;
xlswrite('xlsoutput.xls', M, 'Sheet2','A2');
%指定excel的页面Sheet2
Row1={'e','e2','Ax','Ay'};
xlswrite('xlsoutput.xls', Row1, 'Sheet2','A1');
l1=10;
l2=4;
for i = 1:10
e=120+i*2;
e2=30+i*4;
A...
Row1={'e','e2','Ax','Ay'};
xlswrite('xlsoutput.xls', Row1, 'Sheet2','A1');
l1=10;
l2=4;
M=zeros(10,4);
for i = 1:10
e=120+i*2;
e2=30+i*4;
Ax = l1*cosd(e)-l2*cosd(e2);
Ay = l1*sind(e)+l2*sind(e2);
M(i,:)=[e e2 Ax Ay];
end;
xlswrite('xlsoutput.xls', M, 'Sheet2','A2');
mathjiang
2008-08-26, 21:16
再一次向坛友学习了,感觉真的很好!!!
mathjiang
2008-08-26, 21:25
随便问一下各位大侠,如何从excel读入数据到matlab,越详细越好哈。偶遇到了如下问题:
》xlsread('petrol.xls','a2:i11')
??? Error using ==> xlsread at 262
File D:\我的文档\MATLAB\petrol.xls not in Microsoft Excel Format.
vBulletin® v3.8.3,版权所有 ©2000-2025,Jelsoft Enterprises Ltd.