使用fplot时,x轴和y轴限制的正确语法是什么?

时间:2019-01-19 22:59:35

标签: matlab plot matlab-figure

输入

disp('Solution Domain Range Input')
prompt='lims='; lims=input(prompt);
disp(' ')

输出 解决方案域范围输入

lims=[-3 3 ] works fine, x axis range is from -3 to 3

也尝试过

lims=[-3 3 -3 3 ] gives error message

...

输入

odes = diff(Y)== A*Y + B
[xSol(t), ySol(t)] = dsolve(odes);
xSolvpa = vpa(xSol)
ySolvpa = vpa(ySol)
fplot(xSolvpa, lims)
hold on
fplot(ySolvpa,lims)

错误味精

Error using fplot (line 145)
Invalid parameter '-3  3 -...'.

怎么办? MM

1 个答案:

答案 0 :(得分:0)

解决方案!

lims=[-1.1 1.5 -1 3]    
fplot(xSolvpa)
axis(lims)