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개)

GCE  karad
GCE karad 2014년 5월 5일
my program is some thing like this a=10; for x=0:.1:1 y=a*x end

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2014년 5월 5일

답변:

2014년 5월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by