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

 采纳的回答

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.

更多回答(1 个)

类别

帮助中心File Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by