Echo off or semicolon in GUI

조회 수: 1 (최근 30일)
Birch
Birch 2017년 9월 29일
댓글: OCDER 2017년 9월 29일
This might be very basic (stupid) question but I will ask anyway. Does eat make sense to use echo off in a matlab GUI, and does it make the program run faster? Which is the preferred, echo off or semicolon after each function. And finally, how do I place/use the echo off in a GUI code. Thanks from a novice.

채택된 답변

OCDER
OCDER 2017년 9월 29일
  • It makes sense to use echo off pretty much every time. Although echo on is used for debugging purposes, there are better way to debug code via error messages and the debugger.
  • echo off is faster, no time spent printing message.
  • always use semicolon to suppress function outputs. It should be a habit to use ";" as many programming languages uses the semicolon to end a statement.
  • if you use semicolon, you don't have to place echo off in your GUI, unless you want it to turn echo on / off as part of a debugger option for your GUI.
  댓글 수: 5
Birch
Birch 2017년 9월 29일
Hi Robert and Donald. Thanks a lot for the answers and examples. Great help.
OCDER
OCDER 2017년 9월 29일
You're Welcome!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by