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

display optionsfor loop

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

Best 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.