how to print variables in command window with message

A=[1, 3,4]
I want to print size of A is length(A) and A is print(A , length(A))

 Respuesta aceptada

I had to make some guesses about exactly what you want output.
varname = 'A';
varlength = length(A);
fprintf('size of %s is %d\n', varname, varlength);
fprintf('%s is', varname);
fprintf(' %g', [A(:); varlength]);
fprintf('\n');

Más respuestas (0)

Categorías

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

Productos

Etiquetas

Preguntada:

el 13 de Dic. de 2015

Respondida:

el 13 de Dic. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by