|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
有这个函数:
: S, U7 H) e2 O: U- function [A] = Test(a,b)
- A(1,1)=a+1;
- A(1,2)=b;
- end
# {, S- q9 v7 G$ G6 M( r; d 4 r. a c. i1 x0 j
" u% }! g9 m4 x- O( B" Z6 O
8 t/ [& X! K% I2 Z9 Q$ N3 V- g存为 Test.m文件8 g+ y6 t. x$ @0 s
然后在command window输入:. E( t8 C2 p- _( _0 O% N" }0 v
>> syms a b+ j3 j% d; L& E
>> Test(0,b)
8 W) P' P* i- Q) G系统报错:/ _2 v( r6 k: N w) f/ d6 K
The following error occurred converting from sym to double:
3 e5 g: J3 D2 F$ f- jDOUBLE cannot convert the input expression into a double array.) S, ]2 z+ L% F. \
Error in Test (line 3)/ x4 u# V: g/ f; U1 T u& x6 @. A
A(1,2)=b;
7 d7 x2 h: h+ \5 e$ R$ I5 ]
. w: [; W# M% y* i8 l/ u' M8 ]8 P(照理说结果应该是A=[1,b]),很奇怪。 |
|