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

 Accepted Answer

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.

More Answers (1)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

on 5 May 2014

Answered:

on 5 May 2014

Community Treasure Hunt

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

Start Hunting!