How to print results from damp() to text file
조회 수: 1 (최근 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에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!