How to know where the >> are in the command window?

조회 수: 2 (최근 30일)
Marine Piou
Marine Piou 2019년 12월 19일
댓글: ME 2019년 12월 19일
I would like to know if there is a matlab command to know where the '>>' will be at the end of a function execution.
For example if I do
fprintf('AAAAAAAAAAAAAAA')
I will get on the next command line
AAAAAAAAAAAAAAA>>
The '>> ' are in the different position than the default position when I open Matlab. Is there a way to get where that position is?
Thanks
  댓글 수: 4
Stephen23
Stephen23 2019년 12월 19일
There is no trivial way to do this once the strings have been printed.
The simplest approach is to keep track of this yourself, by adding a flag to your code that indicates if that particular message has been printed or not.
Marine Piou
Marine Piou 2019년 12월 19일
Thanks for your answer, I'll see how I can add a flag inside my code.

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

답변 (1개)

Adam
Adam 2019년 12월 19일
Just use
fprintf('AAAAAAAAAAAAAAA\n')
instead and it will put the new line at the end so that the >> will be on the next line where you expect it to be.
  댓글 수: 1
ME
ME 2019년 12월 19일
The original posted has said in a comment above:
"I don't want to use the '\n' because I don't want to pollute my screen with the same message n times (so n lines). n can vary between 1 and 0.5million."

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by