not displaying answers in command window for this special command

2 ビュー (過去 30 日間)
mohammad
mohammad 2011 年 9 月 8 日
for not displaying answers in command window for eval(rrr) , eval(ttt) what i must do?
iterval1='444444';
d=sprintf('m%d',1);
c=sprintf('m%d_%d',1,2);
rr=eval(iterval1(1,1:3));
tt=eval(iterval1(1,5:end));
rrr =sprintf('%s=%d',d,rr);
ttt=sprintf('%s=%d',c,tt);
eval(rrr); % what must i do to not displaying this in command widow
eval(ttt); % what must i do to not displaying this in command widow
  1 件のコメント
Oleg Komarov
Oleg Komarov 2011 年 9 月 8 日
Are you trying to create variables in a loop? Don't do it with eval.
http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F

サインインしてコメントする。

採用された回答

Fangjun Jiang
Fangjun Jiang 2011 年 9 月 8 日
Make
rrr=[rrr,';'];
eval(rrr);

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 9 月 8 日
evalc(rrr); %evalc() to "capture" the result of eval(), then semi-colon means throw it away without displaying it
  2 件のコメント
Fangjun Jiang
Fangjun Jiang 2011 年 9 月 8 日
+1, nice to know! Never paid attention!
mohammad
mohammad 2011 年 9 月 8 日
really nice

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeProgramming Utilities についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by