how to display the <1x19 cell> values in msgbox

 Respuesta aceptada

Walter Roberson
Walter Roberson el 29 de Ag. de 2015

0 votos

Every element of a cell array is allowed to be a different type, include structures, objects, multidimensional arrays, strings -- and other cell arrays. Some of those cannot be displayed as text, and some of them are a nuisance to display as text (e.g., 5 dimensional arrays of structures of multidimensional arrays of numeric values.) It is therefore not generally possible to display the contents of a cell array in a msgbox.
Displaying the contents might be practical if the form of the contents is known and fixed.
If the contents are strings you might wish to look at strjoin()

4 comentarios

ajith
ajith el 4 de Sept. de 2015
i use cell2mat to change the cell into an array. i need to display the 19x1 value in msg box . Please explain in coding been useful for me,
Star Strider already showed you
h = msgbox(sprintf('%g\n',cellvct{:})); % Display Cell In ‘msgbox’
The only thing I would change about that would be to use
h = msgbox(sprintf('%g ',cellvct{:})); % Display Cell In ‘msgbox’
Or if you already have an array then
h = msgbox(sprintf('%g ',YourVector)); % Display vector In ‘msgbox’
ajith
ajith el 4 de Sept. de 2015
Editada: ajith el 4 de Sept. de 2015
yes...working great thank you sir
but i mention the name like that (i.e)
h = msgbox(sprintf('Feature area=%g\n',x(1,1)));
h = msgbox(sprintf('Feature volume=%g\n',x(2,1)));
. .
i need to show it fully in one msgbox with specified name and values its possible sir.
x =[149.3; 85.13323; 2; 42.5; sqrt(exp(1))];
msgstr = sprintf('Feature area=%g\nFeature volume=%g\nFeature Euclidean Number=%d\nFeature Perimeter=%g\nFeature Creeper=%g', x(1:5,1));
msgbox(msgstr);

Iniciar sesión para comentar.

Más respuestas (1)

Star Strider
Star Strider el 29 de Ag. de 2015
This works:
cellvct = {randi(99, 1, 19)}; % Create Cell
h = msgbox(sprintf('%g\n',cellvct{:})); % Display Cell In ‘msgbox’

1 comentario

ajith
ajith el 4 de Sept. de 2015
i use cell2mat to change the cell into an array. i need to display the 19x1 value in msg box . Please explain in coding been useful for me,

Iniciar sesión para comentar.

Categorías

Más información sobre App Building en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 29 de Ag. de 2015

Comentada:

el 5 de Sept. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by