Suppress unexpected output to command window
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ilya Tyuryukanov
el 24 de Mayo de 2016
Editada: Ilya Tyuryukanov
el 25 de Mayo de 2016
In my class constructor I have the following lines:
* some code with inputparser to produce inp
obj.scal = inp.scal;
obj.matrix = inp.scal*matrix; % HERE obj is being printed for some reason
* some code to set other obj properties
Somehow, the object contents are printed to the command window after the second command (it assigns a matrix to the obj.matrix property). The class is a normal "data" class. I'm using Matlab R2015b. I've tried echo off, but it doesn't help. The problem is minor yet annoying.
0 comentarios
Respuesta aceptada
Steven Lord
el 24 de Mayo de 2016
Are those the only two lines in the constructor?
How are you calling the constructor? Are you calling it like this?
obj = myObjectConstructor()
If so, try adding a semicolon after the constructor call.
obj = myObjectConstructor();
2 comentarios
Ilya Tyuryukanov
el 25 de Mayo de 2016
Editada: Ilya Tyuryukanov
el 25 de Mayo de 2016
Más respuestas (0)
Ver también
Categorías
Más información sobre Entering Commands en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!