¿how can I show a matrix of type -cell- in a msgbox?

조회 수: 2 (최근 30일)
Pedro Guevara
Pedro Guevara 2019년 6월 25일
댓글: Pedro Guevara 2019년 6월 28일
I annoy them with another great concern that I have. I'm doing a program in which we must show matrices with numeric and non-numeric characters (letters); I am putting these matrices in matrixes of the cell type. What I want is to show these matrices in messages - msgbox -, and try to put them directly (as would be done with a numeric matrix type double) but I get errors, and try making use of several commands like -str2double- and several more, but not I get the matrix to appear in an organized and neat way. Could someone help me with this matter?
I leave a piece of the code, this piece contains one of my matrices that I want to show in -msgbox -
Note: My arrays are not of constant dimensions.
for f=1:NP
[Pos_GL_Y1] = find( NodosT (:,2) == NodosT1(f,1) );
[Minx_piso,Pminx]= min( NodosT( Pos_GL_Y1,1 ) );
Zi (:,f) = abs( Coe_par(f,1) )* M_Sd(f,1); % desplazamientos
Zi_c (:, f) = [ num2cell( Zi (:,f) ) ; ['Mod',num2str(f)] ] ;
Yp(1:NP, f)= Modos (:,f)*Zi(1,f);
Yp(f, 4)= NodosT ( Pos_GL_Y1 (Pminx,1) , 3 );
Yp_c (:, f) = [ num2cell(Yp(1:NP, f)) ; ['Mod',num2str(f)] ] ;
Yp_c {f, NP+1} = ['U ',num2str( NodosT ( Pos_GL_Y1 (Pminx,1) , 3 ) )] ;
menospiso=menospiso+1; % BORRAR
end
cell.png
As shown in the image, I want my matrix "Yp_c" to be seen in a msgboxmsgbox.
Thank you very much for your help.
  댓글 수: 1
Jan
Jan 2019년 6월 26일
"put them directly (as would be done with a numeric matrix type double)" - What does this mean?
"I get errors" - Then please post the code with some inputs and y copy of the complete error message.
"not I get the matrix to appear in an organized and neat way" - The readers cannot guess, what you call "neat and organized". The screen shot is a hint, at least.
"this piece contains one of my matrices that I want to show in -msgbox -" - We cannot run the code due to missing inputs. It is not clear, which array you mean.

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

채택된 답변

Shameer Parmar
Shameer Parmar 2019년 6월 26일
I understood your problem, but I dont know the axact value of matrix 'Yp_c' because it is not properly visible in your questions.
So I took reference of another matrix 'Ys_c' (7 by 4) and creaetd logic here for you.
So you can apply this logic to your matrix by replacing it with actual values.
See attached code... You can modify it as per your requirement.. Thanksss..
  댓글 수: 3
Shameer Parmar
Shameer Parmar 2019년 6월 27일
NO matter of any matrix.. here you can copy my code from line #18 to the end and replace the matrix 'Yp_c' with your matrix name and see the results... You can adjust the code is the output message is not displaying properly..
Please try for this..
If you are still facing issue, then provide me your input files and tell me the expected results.. I can ready to help you.. Good Luck..
Pedro Guevara
Pedro Guevara 2019년 6월 28일
It works perfect. many thanks.

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

추가 답변 (1개)

Jan
Jan 2019년 6월 26일

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by