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窗口,edit→axes properties,在下面出现的property editor窗口中,点击X axis,点击第三行的x scale右边的下拉列表中的log,即可完成。给你个例子:x = 2. ^ (1 : 5: 100);y = log(x);semilogx(x, y, 'o');
>> 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 Multiple Table Variables on One Axis Copy Code Copy Command Since R2022a Create a table containing three variables. Then display the first three rows in the table. Get Input = (1:100)'; Output1 = Input.^2; Output2 = Input.^3; tbl = table(Input,Output1,Output2); head(tbl,3...
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...
Plot the Input variable on the x-axis and the Output variable on the y-axis. Return the Line object as p, and turn the axes grid on. Notice that the axis labels match the variable names. Get p = semilogx(tbl,"Input","Output"); grid on To modify aspects of the line, set the ...
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...
1.axis函数:坐标轴控制 axis( [xmin , xmax , ymin , ymax , zmin , zmax] )———坐标轴范围 axis equal———横纵坐标等长刻度(如横坐标的1和纵坐标的1长度一样0 axis square———产生正方形坐标系(默认为矩形) axis auto———使用默认设置 axis off...
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); ...
plot 1 定义 plot()——matlab中二维画图的函数,函数返回值是各个线条的句柄。 2 调用格式 2.1 plot(y) 当y为向量时,是以y的分量为纵坐标,以元素序号为横坐标,用直线依次连接数据点,绘制曲线。若y为实矩阵,则按列绘制每列对应的曲线。 2.2 plot(x,y) 若y和x