How to print results from damp() to text file
2 次查看(过去 30 天)
显示 更早的评论
I was trying to print the results from the damp() function to a text file using fprintf, but fprintf doesn't support it.
I would like to be able to maintain that same format that you see in the command window when printing it to a text file as well.
The following is a sample of what I would like to be able to output into a separate txt file
damp(tf(1,[12 16 560 180])
4 个评论
Walter Roberson
2018-9-22
>> which damp
/Applications/MATLAB_R2018b.app/toolbox/shared/controllib/engine/damp.m
采纳的回答
Walter Roberson
2018-9-22
evalc() the function to capture the text.
3 个评论
Walter Roberson
2018-9-22
A=evalc('damp(tf(1,[12 16 560 180])');
Note that this will result in a character vector stored in A that will have embedded newline (\n) characters in it, but not embedded carriage returns (\r) .
更多回答(1 个)
Thomas Marcus
2022-1-3
To get more accurate numbers than what is printed on screen, use [wn, zeta, p] = damp(sys) to get the arrays.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!