正在加载图片...
User-defined Functions (7/28) Pass-By-Value Example 2 1 function out=sample(a,b) 2- fprintf('In sample:a=%f,b=%f %f\n',a,b) 3- a=b(1)+2*a: 4- b=a.*b; 5- out=a+b(1); 6- fprintf('In sample:a=%f,b=%f %f\n',a,b) 1- a=2:b=[64]: 2- fprintf('Before sample:a=%f,b=%f %f\n',a,b); 3- out=sample(a,b); 4- fprintf('After sample:a=%f,b=%f %f\n',a,b); 5- fprintf('After sample:out=%f\n',out); By execute the second M.file,what will appear in the command window? 翻凡济大学 TONGJI UNIVERSITYExample 2 By execute the second M.file ,what will appear in the command window? User-defined Functions (7/28) Pass-By-Value
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有