Hello, I need help. How to use the Save function to store code data in Matlab? please.
1 次查看(过去 30 天)
显示 更早的评论
m=[-1 3 -3 1;3 -6 3 0;-3 3 0 0;1 0 0 0]; x=[2,8,8,2]; y=[4.58,19.58,34.58,49.96]; x1=[2,0.66,0.67,-2]; y1=[49.96,49.99,50,49.96]; x2=[-2,4,4,-2]; y2=[4.58,19.58,34.58,49.96]; a=1; b=1; for u=0:0.01:1; for u2=0:45:360; px(a)=[u^3,u^2,u,1]*[m]*[x]'; py(a)=[u^3,u^2,u,1]*[m]*[y]'; px1(a)=[u^3,u^2,u,1]*[m]*[x1]'; py1(a)=[u^3,u^2,u,1]*[m]*[y1]'; px2(a)=[u^3,u^2,u,1]*[m]*[x2]'; py2(a)=[u^3,u^2,u,1]*[m]*[y2]'; x3(a,b)=px(a)*cosd(u2)+py(a)*sind(u2); y3(a,b)=px(a)*-sind(u2)+py(a)*cosd(u2); x4(a,b)=px1(a)*cosd(u2)+py1(a)*sind(u2); y4(a,b)=px1(a)*-sind(u2)+py1(a)*cosd(u2); x5(a,b)=px2(a)*cosd(u2)+py2(a)*sind(u2); y5(a,b)=px2(a)*-sind(u2)+py2(a)*cosd(u2); b=b+1; a=a+1; end; end; Rx1=x3(:); Ry1=y3(:); Rx2=x4(:); Ry2=y4(:); Rx3=x5(:); Ry3=y5(:); c=1; for u1=0:360; px2(c)=0+50*cosd(u1); py2(c)=0+50*sind(u1); px3(c)=0+5*cosd(u1); py3(c)=0+5*sind(u1); px4(c)=0+3*cosd(u1); py4(c)=0+3*sind(u1); c=c+1; end; hold on plot(Rx1,Ry1,'r') plot(Rx2,Ry2,'r') plot(Rx3,Ry3,'r') plot(px2,py2,px3,py3) plot(px4,py4,'b') hold off
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Programming 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!