t = 0:.1:2*pi; y = sin(t); plot(t,y,'r-'); hold on; grid on; axis([min(t) max(t) -max(y) max(y)]); line(t,zeros(1,length(t(:))),'Color','k');
>> plot(x,y1,x,y2) >> grid on >> xlabel('independent variable X') >> ylabel('Dependent Variable Y1 & Y2') >> title('Sine and Cosine Curve') >> text(1.5,0.3,'cos(x)') >> gtext('sin(x)') >> axis([0 2*pi -0.9 0.9]) 图5.1.3 使用了图形修饰的plot 函数绘制的正弦曲线...
在plot窗口,edit→axes properties,在下面出现的property editor窗口中,点击X axis,点击第三行的x scale右边的下拉列表中的log,即可完成。给你个例子:x = 2. ^ (1 : 5: 100);y = log(x);semilogx(x, y, 'o');
plot(1:10); axis manual; % 锁定当前的轴限制 hold on; plot(10:-1:1, 'r-'); axis equal; 添加文本 text(5,25,'A','Fontsize',18,'fontname','Times') % 文本 添加箭头 添加带文字的箭头 % 位置 尺寸 文字 annotation('textarrow',[0.13 0.13],[0.08 0.14],'String','take-off','Font...
plot(x, y):将向量对(x, y)画出来 plot(y):将向量对(x, y)画出来,其中x=[1:n], n=length(y) >> x = [1, 2, 3, 4, 5]; >> y = [1, 2, 3, 4, 5]; >> plot(x, y) >> x = 0: pi/20: 2*pi; >> y = cos(x); ...
semilogx(X,Y) plots x- and y-coordinates using a base-10 logarithmic scale on the x-axis and a linear scale on the y-axis. To plot a set of coordinates connected by line segments, specify X and Y as vectors of the same length. To plot multiple sets of coordinates on the same set...
plot 1 定义 plot()——matlab中二维画图的函数,函数返回值是各个线条的句柄。 2 调用格式 2.1 plot(y) 当y为向量时,是以y的分量为纵坐标,以元素序号为横坐标,用直线依次连接数据点,绘制曲线。若y为实矩阵,则按列绘制每列对应的曲线。 2.2 plot(x,y) 若y和x
set(gca,'xscale','log','yscale','log') set(h1,'Color','k') 1. 2. 3. 4. 亦即只需将y也改为“yscale”即可。 2)plot下使用对数坐标 a) 一支坐标轴用对数坐标,另一支用线性坐标 clc x=-6:0.01:6; y=x; plot(x,y);%一定是自变量x在前,函数y在后,不能搞混,最好也不要只写plot(y...
loglog(X,Y) plots x- and y-coordinates using a base-10 logarithmic scale on the x-axis and the y-axis. To plot a set of coordinates connected by line segments, specify X and Y as vectors of the same length. To plot multiple sets of coordinates on the same set of axes, specify at...
set(get(AX(2),'Ylabel'),'String','Right Y-axis') title('Labeling plotyy'); set(H1,'LineStyle','--'); set(H2,'LineStyle',':'); 1. 2. 3. 4. 5. 6. 7. 8. 极坐标图线 % 螺旋线 x = 1:100; theta = x/10; r = log10(x); ...