I AM USING FOR LOOP AND WANT RESULTS IN ARRAY FORMAT WITHOUT DISPLAYING VARIABLE NAME

AFTER USING FOR, I AM GETTING ANS IN WHICH VARIABLE NAME IS SHOWN AGAIN AND AGAIN. I WANT RESULTS TO DISPLAY IN SINGLE LINE ONE AFTER ANOTHER WITHOUT DISPALYING THE VARIABLE NAME

 Respuesta aceptada

Example:
x = rand( 5, 1 ) ;
for k = 1 : length( x )
fprintf( '%.2f, ', x(k) ) ;
end
fprintf( '\n' ) ;
If you need another behavior, please be more specific and post your code.

Más respuestas (1)

my program is some thing like this a=10; for x=0:.1:1 y=a*x end

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Preguntada:

el 5 de Mayo de 2014

Respondida:

el 5 de Mayo de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by