output

5 visualizaciones (últimos 30 días)
r?za çay
r?za çay el 9 de Dic. de 2011
for example my output: 20 30 40 50 I want to convert ---------------> A(0)=20 <--------------- A(1)=30 A(2)=40 A(3)=50 how can I make this??

Respuesta aceptada

Walter Roberson
Walter Roberson el 9 de Dic. de 2011
A = [20 30 40 50];
fprintf(1, 'A(%d)=%d ', [(0:length(A)-1).' ; A(:)].' );
fprintf(1, '\n');
  5 comentarios
Walter Roberson
Walter Roberson el 10 de Dic. de 2011
Hmmm... I did test at the time I posted.
Did you perhaps omit the ".'" after the [] ?
r?za çay
r?za çay el 11 de Dic. de 2011
ohhhh Paulo this program work well. very thanks Paulo and Walter:))

Iniciar sesión para comentar.

Más respuestas (1)

Paulo Silva
Paulo Silva el 9 de Dic. de 2011
A=[20 30 40 50]
MATLAB index values start at 1 not 0
  2 comentarios
Walter Roberson
Walter Roberson el 9 de Dic. de 2011
Paulo, did you not upgrade to the Purple Agate beta of the Mind Reading Toolbox ? "It assists in allowing trust with your own intuition and opens the spiritual flood gates to a realm of endless possibilities." Are you still using the Amber beta ?
Paulo Silva
Paulo Silva el 10 de Dic. de 2011
I'm always using old versions but will upgrade soon, both MATLAB version and Mind Reading Toolbox ;)

Iniciar sesión para comentar.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by