|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
有这个函数: 0 a- ^3 L- _2 I
- function [A] = Test(a,b)
- A(1,1)=a+1;
- A(1,2)=b;
- end
/ n [' V4 s2 t+ c. w# z0 N |
/ [ |0 ^; P r1 e4 Y
) m* U5 N. E7 z4 O7 X9 E5 ^& e A# _ T: t8 \3 Y' E# A
存为 Test.m文件
" {9 B+ R* E! I9 e* i然后在command window输入:
, R! p. O* t( m- ^6 w1 I2 t. V! Y>> syms a b
8 _$ }& Z( a4 F& D6 B& w>> Test(0,b)
" G: ^: d4 K3 ]2 U系统报错:
- t8 W2 q. c1 I T- d! S* E" HThe following error occurred converting from sym to double:4 [8 S+ h$ o, Q! w& |* n
DOUBLE cannot convert the input expression into a double array.
0 u. ~, a+ M3 U- D5 F+ k2 RError in Test (line 3)
4 Y4 x* K+ p3 Y# y7 x A(1,2)=b;& w5 t0 g5 s8 K, V
; E. p8 ~) O1 s6 i
(照理说结果应该是A=[1,b]),很奇怪。 |
|