chap4 关于matlab的程序设计(5)
时间:2026-01-19
时间:2026-01-19
程序设计
用来控制M文件在执行过程中显示与否,这对程序的调试和演示极为有用。 对命令文件
echo on 显示其后所有执行文件的指令
echo off 关闭显示其后所有执行文件的指令
echo 在两种状态之间进行转换
对函数文件或命令文件
echo filename on 使filename指定文件中的指令在执行时显示出来 echo filename off
echo on all 使当前内存中函数文件的指令在执行中显示出来
echo off all
4.4
sprintf('%0.5g',(1+sqrt(5))/2) 1.618
sprintf('%0.5g',1/eps) 4.5036e+15
sprintf('%15.5f',1/eps) 4503599627370496.00000
sprintf('%d',round(pi)) 3
sprintf('%s','hello') hello
sprintf('The array is %dx%d.',2,3) The array is 2x3.
sprintf('\n') is the line termination character on all platforms 数据显示格式控制
上一篇:12条模拟电路设计经验总结
下一篇:办公室文化申报表