相关代码 |
|
%例10-11 try-catch模块的应用举例。 >> X=magic(4); >> Y=ones(4,3); >> try Z=X*Y catch Z=nan; disp('X and Y is not conformable.') end >>Z >> X=magic(4); >> Y=ones(3,3); >> try Z=X*Y catch disp('Xand Y is not conformable.') end X and Y is not conformable. >>