MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [求助]看看我的matlab程序错在哪里 (https://www.labfans.com/bbs/showthread.php?t=5355)

huanghuan 2008-11-16 17:10

[求助]看看我的matlab程序错在哪里
 
我的程序如下:
z=input('输入n=')
if (z>8)
b=rand(2,z);%b为2*8随机矩阵
x=b(1,:);%x为自变量
y=b(2,:);%y为函数值
a=max(x)%a为自变量中的最大值
c=min(x)%b为自变量中的最小值
p=polyfit(x,y,9);%有点系列确定多项式
x0=input('请输入数据x0=');
else if (x0>c)%判断输入的x0是否满足条件
y0=polyval(p,x0)
else (x0<a)
y0=polyval(p,x0)
end
end
end
运行时发现错误,请指正。

william 2008-11-16 18:34

回复: [求助]看看我的matlab程序错在哪里
 
else (x0<a)..............此处可能少了个if。


所有时间均为北京时间。现在的时间是 03:03

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.