|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
有这个函数: ! a) D }. a+ `8 C( }) I) X4 \
- function [A] = Test(a,b)
- A(1,1)=a+1;
- A(1,2)=b;
- end0 ~+ S. e+ I5 e f6 C4 ] L3 M4 ]: z" d
# A! v3 \3 i% V7 Z0 B8 i
2 z$ p0 U. B# Q$ c' M5 V7 @5 x$ R6 Y
. o9 ]% U6 p: A存为 Test.m文件
' m/ C+ k' r- n8 N然后在command window输入:
+ V4 W+ C6 M1 k>> syms a b
% |+ J& _9 o4 A& P. A5 l- o>> Test(0,b)) t+ k1 y0 i9 z$ F+ E
系统报错:. S" M+ m, i0 e7 i1 H, y% d
The following error occurred converting from sym to double:
' k! P& r* h: `; A0 _, X0 R: ZDOUBLE cannot convert the input expression into a double array. }7 k1 H+ d4 j6 a. t' T H _* S
Error in Test (line 3)
- F Z$ \- n% J5 l A(1,2)=b;& E$ p) ~7 B1 [4 z5 M$ {8 J8 y P
+ z, z V" s9 ~+ p/ J1 Z( N/ |
(照理说结果应该是A=[1,b]),很奇怪。 |
|