|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
有这个函数:
* W; q9 c% n% m) Q* X' d- function [A] = Test(a,b)
- A(1,1)=a+1;
- A(1,2)=b;
- end" r/ W: s( |6 [0 i2 @
( |% d' T5 f- e& O: l: i: m
1 P' N9 S9 s0 a. a* p$ @* B
1 \: |- h8 b2 R8 B( s存为 Test.m文件% e) R, D' |% ]) {: l; S2 W
然后在command window输入:/ ?7 ]. {3 o9 b/ g
>> syms a b& H) O, N% B8 s. S' P7 {
>> Test(0,b)* P6 r) t1 Q& p. X
系统报错:7 _2 D, a6 _! j
The following error occurred converting from sym to double:2 D4 T6 P b0 b
DOUBLE cannot convert the input expression into a double array." g: U0 K% L3 T4 K6 o, s/ n
Error in Test (line 3)
6 D7 @8 N* Z" S, Q% a A(1,2)=b;0 \3 p- W3 m0 F
9 z4 ]. i& f2 o y(照理说结果应该是A=[1,b]),很奇怪。 |
|