¿how can I show a matrix of type -cell- in a msgbox?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Pedro Guevara
am 25 Jun. 2019
Kommentiert: Pedro Guevara
am 28 Jun. 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
![cell.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/226331/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 Kommentar
Jan
am 26 Jun. 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.
Akzeptierte Antwort
Shameer Parmar
am 26 Jun. 2019
Hello Pedro Guevara
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 Kommentare
Shameer Parmar
am 27 Jun. 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..
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..
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Data Type Identification finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!