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

 採用された回答

Cedric
Cedric 2014 年 5 月 5 日
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 日

0 投票

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

カテゴリ

ヘルプ センター および File ExchangeLoops 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