matlab-dlmwrite和diary输出数据
diary用于记录MATLAB窗口的输入 的命令和响应输出,diary off关闭记录,diary on打开记录
>> diary('log.txt')
>> eval('aa='aaaabbb'')
??? eval('aa='aaaabbb'')
|
Error: Unexpected MATLAB expression.
>> eval('aa=23455')
aa =
23455
>> double('abcdef')
ans =
97 98 99 100 101 102
>> integer('abcdef')
??? Undefined function or method 'integer' for input arguments of type
'char'.
>> int('abcdef')
ans =
abcdef^2/2
>> diary off
>>
'log.txt'内容如下:
eval('aa='aaaabbb'')
??? eval('aa='aaaabbb'')
|
{Error: Unexpected MATLAB expression.
}
eval('aa=23455')
aa =
23455
double('abcdef')
ans =
97 98 99 100 101 102
integer('abcdef')
{??? Undefined function or method 'integer' for input arguments of type
'char'.
}
int('abcdef')
ans =
abcdef^2/2
diary off
dlmwrite将矩阵室到ascii定界符文件中
>> P=[0 1 0 1 1;1 1 1 0 0]
P =
0 1 0 1 1
1 1 1 0 0
>> dlmwrite('aaa.txt',P)
aaa.txt内容如下:
0,1,0,1,1
1,1,1,0,0
>> csvwrite('ss.dat',P)
>>