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

3 vues (au cours des 30 derniers jours)
Pedro Guevara le 25 Juin 2019
Commenté : Pedro Guevara le 28 Juin 2019
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
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 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Jan le 26 Juin 2019
"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.

Connectez-vous pour commenter.

Réponse acceptée

Shameer Parmar le 26 Juin 2019
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 commentairesAfficher 1 commentaire plus ancienMasquer 1 commentaire plus ancien
Shameer Parmar le 27 Juin 2019
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..
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 le 28 Juin 2019
It works perfect. many thanks.

Connectez-vous pour commenter.

Plus de réponses (1)

Jan le 26 Juin 2019
0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by