필터 지우기
필터 지우기

how to supress a output of a function in command window

조회 수: 1 (최근 30일)
Jason
Jason 2016년 2월 23일
댓글: Jason 2016년 2월 26일
Hi, there! I met a problem. If the output of my function is a1,a2,a3, like the right form: [a1,a2,a3]=function(b1,b2,b3);
As the size of a3 is very large, so I want variables a1,a2 and the computational time are displayed in the command window, while variable a3 only shows in worksapce. Is there any function I could use to satisfy the need?
Thank you very much!

채택된 답변

John D'Errico
John D'Errico 2016년 2월 23일
편집: John D'Errico 2016년 2월 23일
The obvious:
[a1,a2,a3]=function(b1,b2,b3);
a1
a2
The point being that when there is no need for something sophisticated, why not use the trivial?
  댓글 수: 4
Stephen23
Stephen23 2016년 2월 25일
편집: Stephen23 2016년 2월 25일
@Jason: Your point is not clear. Use semicolons to suppress output. This includes inside your function. When every line of your function has a semicolon then calling
[a1,a2,a3]=function(b1,b2,b3);
will not display anything in the command window. John D'Errico's answer is prefectly correct. However we don't know exactly what you are doing, as you have not shown us any code.
Jason
Jason 2016년 2월 26일
Thank you very much ! I didn't see the semicolon in the function line, so carelessness.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by