Output a matrix with symbols

조회 수: 7 (최근 30일)
Drilon Ferra
Drilon Ferra 2021년 7월 8일
답변: Sindhu Karri 2021년 7월 13일
How do I output a figure or pop-up box with matrix which has symbols in it? I tried using uitable but without success. The input MatrixXangle is assumed to be a letter instead of a numeric value.
MatrixXangle = inputdlg({'Angle'})
str2sym({MatrixXangle});
R_termX = [1 0 0 ; 0 cosd(Ang) -sind(Ang) ; 0 sind(Ang) cosd(Ang)]
uit = uitable(uifigure,'Data', R_termX);
Is there any way the output could be converted to an image or something else to allow for the output
  댓글 수: 1
Drilon Ferra
Drilon Ferra 2021년 7월 8일
I ended up using Live Script, as this displayed matrices clearly (including matrices with symbols) when using
sympref('MatrixWithSquareBrackets', true)
sym(R_termX)

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

답변 (1개)

Sindhu Karri
Sindhu Karri 2021년 7월 13일
Hii,
According to my understanding of the question,you want to display the array R_termX as a table using the uitable, which takes MatrixXangle as input angle.
One other way could be ,modifying the above mentioned as follows
matrixXangle = inputdlg({'Angle'});
ang=str2double(cell2mat(matrixXangle));
R_termX = [1 0 0 ; 0 cosd(ang) -sind(ang) ; 0 sind(ang) cosd(ang)];
uit = uitable(uifigure,'Data', R_termX);
Refer to below links for more information

카테고리

Help CenterFile Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by