How does "disp" formatting work exactly?

조회 수: 22 (최근 30일)
dsmalenb
dsmalenb 2019년 5월 16일
댓글: Walter Roberson 2019년 5월 17일
Greetings,
I am converting some PDFs using Matlab and the way I want the final text to look is exactly how "disp" displays it. However, I am scratching my head of how to capture that in a way that I can write it to a word document or capure that exact process that "disp" does using fprintf. Any ideas?

채택된 답변

Walter Roberson
Walter Roberson 2019년 5월 16일
None of the disp() formats correspond to single fprintf() formats. They all examine the range and data type of what they are displaying and choose output format dynamically. The output it uses for a vector of values might be different than what it uses for the values individually.
You can evalc() to capture the results of disp(), or you might be able to use diary() for your purposes.
  댓글 수: 2
dsmalenb
dsmalenb 2019년 5월 17일
I used diary and it works ... somewhat. evalc seems to require a string to process and since I need to update the location dynamically it doesn't seem to like to accept that with the strcat function.
Basically, how do you write to a text doc how Matlab would display it in the command window automatically?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by