![]() |
[求助]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: |
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); |
回复: matlab excel
偶也学到了,谢谢楼上坛友!!
|
回覆: matlab excel
好厲害唷,果真高手雲集,要跟你們督多學習:lovely:
|
回复: matlab excel
也只是新手而已
一起学习了 |
回复: matlab excel
%指定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'); |
回覆: 回复: matlab excel
謝謝唷 又多會一種方法
|
回复: matlab excel
[QUOTE=mtseasky;14625]%指定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...[/QUOTE] [CODE]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');[/CODE] |
回复: matlab excel
再一次向坛友学习了,感觉真的很好!!!
|
回复: matlab excel
随便问一下各位大侠,如何从excel读入数据到matlab,越详细越好哈。偶遇到了如下问题:
》xlsread('petrol.xls','a2:i11') ??? Error using ==> xlsread at 262 File D:\我的文档\MATLAB\petrol.xls not in Microsoft Excel Format. |
所有时间均为北京时间。现在的时间是 11:15。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.