how to supress a output of a function in command window
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Jason
el 23 de Feb. de 2016
Comentada: Jason
el 26 de Feb. de 2016
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!
0 comentarios
Respuesta aceptada
John D'Errico
el 23 de Feb. de 2016
Editada: John D'Errico
el 23 de Feb. de 2016
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 comentarios
Stephen23
el 25 de Feb. de 2016
Editada: Stephen23
el 25 de Feb. de 2016
@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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Whos en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!