x=[61.04, 244.14, 549.32, 976.56, 1525.88, 2197.27, 2990.72, 3906.25, 4943.85, 6103.52, 7385.25, 8789.06];%initial value
n=12;%n为x的数目
y=[ ];%存放 y序列
For i=1:n
temp1=1+a*x(i)
temp2=1+b*x(i).^2-c*x(i)+a*x(i)
y(i)=temp1./temp2
next i
Print y
End
=[1.1278, 1.1833, 1.1111, 1.0866, 1.0793, 1.7018, 1.0621, 0.8423,
1.4921, 1.3306, 1.1057, 1.1509] ;%initial value
k=12;%k为的数目
z=[ ];%存放 z序列
P=0
For i=1:k
Z(i)=[y(i)-].^2
t=p+z(i)
Next i
M=Min(t)
Print a,b,c
Plot(x,y)
End
为什么会出现
Warning: Could not find an exact (case-sensitive) match for 'For'.
C:\Program Files\MATLAB\R2008b\toolbox\matlab\lang\for.m is a case-insensitive
match and will be used instead.
You can improve the performance of your code by using exact
name matches and we therefore recommend that you update your
usage accordingly. Alternatively, you can disable this warning using
warning('off','MATLAB:dispatcher:InexactCaseMatch').
This warning will become an error in future releases.
??? Attempt to execute SCRIPT for as a function:
C:\Program Files\MATLAB\R2008b\toolbox\matlab\lang\for.m
能qq详细聊不,毕业设计,急啊
改成这样后提示
Undefined function or variable 'a'.
原意是求
你的a,b,c都没有定义就用了,所以提示找不到变量a,还有M=Min(t),t是什么也没定义。。。。
还是不行啊,提示
??? for i=1:n
|
Error: The input character is not valid in MATLAB statements or expressions.
for i=1:n,中间不要带空格而且必须都是英文输入法下的,你这明显是中文的冒号