| 
 | 
	
    
 
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册  
 
x
 
有这个函数:  
+ n8 E7 P$ m9 v$ c3 V7 q  c- function [A] = Test(a,b)
 -    A(1,1)=a+1;
 -    A(1,2)=b;
 - end$ [; D% Y1 F+ v3 X7 a
 
  $ T" I  q  m& n4 S+ l6 t 
 
5 d$ ?! N  Q% h. R# Z, }7 P$ t& ^3 V8 i, {/ C; a 
存为 Test.m文件* D& n2 k. f1 P8 o5 j5 v4 E 
然后在command window输入:! n. ?3 n; m( Q 
>> syms a b% u) W/ R: c: W8 G4 U' z* L 
>> Test(0,b)5 h* [8 y" s5 y" D 
系统报错:1 M& E+ ~1 l6 Q7 F2 q$ W 
The following error occurred converting from sym to double: 
. {1 I) U6 ?- @. W, \/ NDOUBLE cannot convert the input expression into a double array.2 e$ t* |$ X# U9 d$ F' ]* R2 u 
Error in Test (line 3) 
5 t+ X( I3 p: U3 W/ V   A(1,2)=b; 
  P8 S& F/ D) w 
6 T( x. h9 ~  ~) e/ w% N(照理说结果应该是A=[1,b]),很奇怪。 |   
 
 
 
 |