文件名称:formats
介绍说明--下载内容均来自于网络,请自行研究使用
类似于fortran语言的格式控制
用法:
s=formats(n1,s1,n2,s2,...)
s1,s2为字符型,n1,n2为整型,如果值等于1,可以忽略不写
例如用于控制输出:
x=rand(1,5) y=[ hello where which ] z=1:3
sprintf([ x= ,formats(5, 5.2f , \n ), y= ,formats( s , \n ), z= ,formats(3, d )],x,y ,z)
formats(5, 5.2f )表示5个 5.2f格式的输出,而不用写5次了,这一点matlab
没有fotran自带的好- quick replicates simple format string and compose a complex format string
Usage:
s=formats(|[times1],formatstring1,|[times2],[formatstring2],...)
s return times1 replicates formatstring1,then times2 replicates formatstring2, ...
for example:
x=rand(1,5) y=[ hello where which ] z=1:3
sprintf([ x= ,formats(5, 5.2f , \n ), y= ,formats( s , \n ), z= ,formats(3, d )],x,y ,z)
See also FORMAT, REPMAT, FPRINTF, SPRINTF
用法:
s=formats(n1,s1,n2,s2,...)
s1,s2为字符型,n1,n2为整型,如果值等于1,可以忽略不写
例如用于控制输出:
x=rand(1,5) y=[ hello where which ] z=1:3
sprintf([ x= ,formats(5, 5.2f , \n ), y= ,formats( s , \n ), z= ,formats(3, d )],x,y ,z)
formats(5, 5.2f )表示5个 5.2f格式的输出,而不用写5次了,这一点matlab
没有fotran自带的好- quick replicates simple format string and compose a complex format string
Usage:
s=formats(|[times1],formatstring1,|[times2],[formatstring2],...)
s return times1 replicates formatstring1,then times2 replicates formatstring2, ...
for example:
x=rand(1,5) y=[ hello where which ] z=1:3
sprintf([ x= ,formats(5, 5.2f , \n ), y= ,formats( s , \n ), z= ,formats(3, d )],x,y ,z)
See also FORMAT, REPMAT, FPRINTF, SPRINTF
(系统自动生成,下载前可以参看下载内容)
下载文件列表
formats.m