matlab常用语言汇总2
- 格式:doc
- 大小:54.00 KB
- 文档页数:15
buptmatlab@ buptmatlabyxl
>> a=[1 2 3]
a =
1 2 3
>> a=[1,2,3]
a =
1 2 3
>> a=[1,2,3]'
a =
1
2
3
>> a=[1,2,3;4,5,6]
a =
1 2 3
4 5 6
>>
>> t=0:0.01:2*pi
>> signal=sin(t);
>> plot(t,signal)
>> signal=sin(10t);
signal=sin(10t);
|
错误: 不应为MA TLAB 表达式。
>> signal=sin(10*t);
>> plot(t,signal)
>> signal=sin(t);
plot(t,signal)
>> plot(t,signal)
>> hold on
>> sii=sin(10*t);
>> plot(t,sii,'r')
>> help plot
plot - 2-D line plot
This MA TLAB function creates a 2-D line plot of the data in Y versus the
corresponding values in X.If X and Y are both vectors, then they must have equal length and MATLAB plots Y versus X.If X and Y are both matrices, then they must have equal size and MA TLAB plots columns of Y versus columns of X.If one of X or Y is a vector and the other is a matrix, then the matrix must have dimensions
such that one of its dimensions equals the vector length.
plot(X,Y)
plot(X,Y,LineSpec)
plot(X1,Y1,...,Xn,Yn)
plot(X1,Y1,LineSpec1,...,Xn,Yn,LineSpecn)
plot(Y)
plot(Y,LineSpec)
plot(___,Name,Value)
plot(axes_handle,___)
h = plot(___)
plot 的参考页
另请参阅gca, hold, legend, LineSpec, title, xlabel, xlim, ylabel, ylim
名为plot 的其他函数
simulink/plot, curvefit/plot, finance/plot, fixedpoint/plot, mpc/plot,
rf/plot, wavelet/plot, simscape/simscape.logging.plot
>> plot(sii,signall,t)
未定义函数或变量'signall'。
是不是想输入:
>> plot(sii,signal,t)
错误使用plot
数据必须为单一矩阵Y 或X,Y 配对列表
>> plot(sii,t,signal,t)
>> plot(t,sii,t,signal)
>> h=plot(t,signal)
h =
262.0011
>> set(h,'color','r')
>> plot(t,signal)
>> plot(t,signal)
>> plot(t,signal)
>> set(h,'color','r')
错误使用handle.handle/set 对象无效或已删除。
>> h=plot(t,signal)
h =
174.0048
>> set(h,'color','r')
>> set(h,'linewidth',5)
>> a=[5,1,2,3]
a =
5 1 2 3
>> a(1)
ans =
5
>> a(3)
ans =
2
>> b=[1,2,3;4,5,6]
b =
1 2 3
4 5 6
>> b(2,3)
ans =
6
>> b(3,2)
索引超出矩阵维度。
>> b(3,2)=7
b =
1 2 3
4 5 6
0 7 0
>> b(100,101)
索引超出矩阵维度。
>> b(100,101)=5
>> a=[1,2,3,4,5,6,7,8,9,10;11,12,13,14,15,16,17,18,19,20]
a =
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20 >> a=[1:10;11:20]
a =
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
>>
>> c=3+4i
c =