How to simply output LaTeX in MatLab app designer?
이전 댓글 표시
I am pretty new to App designer. I couldn't find an answer to this question. I want to output a LaTeX matrix in app designer but not in an UIAxes just simply somehow in UIFigure. I tried to use table:
Out = [symtext1 number1 symtext4; symtext2 number2 symtext5; symtext3 number3 symtext6];
latex_Out = latex(str2sym(Out));
app.OutputTable.Data = latex_Out;
but this only gets me a table with an error:
"Error setting property 'Data' of class 'Table':
Data must be a numeric, logical, string, cell, or table array"
or a table full of [1x1 sym] (depends on if I use str2sym or sym).
I also tried to display it in a layout grid with :
GridLayout = uigridlayout(Panel);
GridLayout.ColumnWidth = {'1x', '1x', '1x'};
GridLayout.RowHeight = {'1x', '1x', '1x'};
for i = 1:3
for j = 1:3
Output = uilabel(GridLayout,"Text",Out(i,j))
Output.Layout.Row = i;
Output.Layout.Column = j;
end
end
but this didn't work. It got me this error:
"Error using sym>convertChar (line 1557)
Character vectors and strings in the first argument can only specify a variable or number. To evaluate character vectors and strings representing symbolic expressions, use 'str2sym'.
Error in sym>tomupad (line 1273)
S = convertChar(x);
Error in sym (line 229)
S.s = tomupad(x);
Error in cell2sym (line 31)
Csym = cellfun(conv, C, 'UniformOutput', false);
Error in sym>tomupad (line 1285)
xsym = cell2sym(x);
Error in sym (line 229)
S.s = tomupad(x);"
and with converting Out to sym [sym(Out)]: "Error using uilabel (line 36)
'Text' must be a character vector, or a 1-D array of the following type: cell array of character vectors, string, or categorical."
Am I doing something simple wrong? Is there a way to display a LaTeX matrix or LaTeX text in UI figure or its components? I also tried to use pretty much every ___2sym conversion within the matrix to get the LaTeX output displayed on screen but nothing worked.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!