How to show latex by override `disp` in classdef?
classdef Myclass
properties
R;
end
methods
function obj = PointGroupElement(R)
obj.R = R;
end
function disp(obj)
symMatrixStr = symmatrix(‘R(1/3,[0,0,1])’);
disp(symMatrixStr);
end
end
end
When I run this class in live editor, I expect return or show latex form R(1/3,[0,0,1]) rather that str ‘R(1/3,[0,0,1])’, and i also know, it will return latex form when i run symMatrixStr = symmatrix(‘R(1/3,[0,0,1])’) in live editor. So, what should i do to override disp so that the class outputs the latex form?classdef Myclass
properties
R;
end
methods
function obj = PointGroupElement(R)
obj.R = R;
end
function disp(obj)
symMatrixStr = symmatrix(‘R(1/3,[0,0,1])’);
disp(symMatrixStr);
end
end
end
When I run this class in live editor, I expect return or show latex form R(1/3,[0,0,1]) rather that str ‘R(1/3,[0,0,1])’, and i also know, it will return latex form when i run symMatrixStr = symmatrix(‘R(1/3,[0,0,1])’) in live editor. So, what should i do to override disp so that the class outputs the latex form? classdef Myclass
properties
R;
end
methods
function obj = PointGroupElement(R)
obj.R = R;
end
function disp(obj)
symMatrixStr = symmatrix(‘R(1/3,[0,0,1])’);
disp(symMatrixStr);
end
end
end
When I run this class in live editor, I expect return or show latex form R(1/3,[0,0,1]) rather that str ‘R(1/3,[0,0,1])’, and i also know, it will return latex form when i run symMatrixStr = symmatrix(‘R(1/3,[0,0,1])’) in live editor. So, what should i do to override disp so that the class outputs the latex form? latex, display, class MATLAB Answers — New Questions