询问关于数学绘图方面问题。
Show older comments
下面这个代码是用来绘图的,绘的是sin(x),sin(2x),sin(3x);我目前有个问题就是,这个程序是我在书上copy下来的,但是matlab始终报错,
x1=0:0.02*pi:2*pi;
y1=[sin(x1);sin(2*x1);sin(3*x1);];
figure1=figure('PaperPositon',[0.6345 6.345 20.3 15.23],'PaperSize',[20.98 29.68]);
axes1 = axes('Parent',figure1);
axis(axes1,[0 6.283 -2 2]);
title(axes1,'sin(x)/sin(2x)/sin(3x)');
xlabel(axes1,'x');
ylabel(axes1,'y');
box(axes1,'on');
hold(axes1,'all');
plot1 = plot(x1,y1);
text1 = text('Position',[1.136 -0.9532 0],'String','y=sin(x)','VerticalAlignment','baseline','Parent',axes1)';
text2 = text('Position',[2.266 -0.8947 0],'String','y=sin(2x)','VerticalAlignment','baseline','Parent',axes1)';
text3 = text('Position',[3.395 -0.8947 0],'String','y=sin(3x)','VerticalAlignment','baseline','Parent',axes1)';

Accepted Answer
More Answers (0)
Categories
Find more on 图形对象 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!