I need an easy way to suppress and bring back the command windows output without using and removing the semicolon all the time, since there are a lot of lines I need to see sometimes.

댓글 수: 1

Dennis
Dennis 2019년 3월 8일
Can you show an example why you want to remove the semicolon in the first place?

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

 채택된 답변

Guillaume
Guillaume 2019년 3월 8일

0 개 추천

Sounds like you want to toggle output on and off probably for debugging purpose. In that case, you should be using the debugging tools instead.
Otherwise, a well written program should be explicit about wanting to display something to the command window, not leave it to the absence of a semi-colon, which most people (and matlab code analyser) would consider a coding error. So:
something = someexpression; %always terminate with semicolon
if dooutput
disp(something); %Now it's clear that you want to display it and that it's not a mistake
end

댓글 수: 1

MARCO MENCHETTI
MARCO MENCHETTI 2019년 3월 8일
Thank you, that is so easy I should have known.
Again, thank you for yor time.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Variables에 대해 자세히 알아보기

질문:

2019년 3월 8일

댓글:

2019년 3월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by