フィルターのクリア

Getting For loop Output On GUI

1 回表示 (過去 30 日間)
mohamed
mohamed 2012 年 12 月 22 日
i have this loop code and on matlab i get the out i want but on GUI its not working.....
for nn=1:a
stri=character(nn);
stri=strcat(stri,':');
stri=strcat(stri,num2str(probabilities(nn)));
stri=strcat(stri,':');
stri=strcat(stri,num2str(codewords{nn}(length(codewords{nn}):-1:1)))
end
what i get on matlab:
:.234:0 1
A:.254:1101
C:.123:10001
D:.112:1001100
F:.234:0001110
but my problem is when i put it on GUI its keep getting me the last stri GUI out Put:
F:.234:0001110
which the last one i have on the stri
and im using this codes to get it on GUI :
nnn=num2str(stri);
set(handles.EditBox,'string',nnn)
i want to get every step that loop doing on GUI not only the final results
any help will be so grateful.....
Thank you
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 12 月 22 日
What is character

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

採用された回答

Walter Roberson
Walter Roberson 2012 年 12 月 25 日
outstrings = cell(a, 1);
for nn=1:a
stri=character(nn);
stri=strcat(stri,':');
stri=strcat(stri,num2str(probabilities(nn)));
stri=strcat(stri,':');
stri=strcat(stri,num2str(codewords{nn}(length(codewords{nn}):-1:1)));
outstrings{nn} = stri;
end
set(handles.Editbox, 'String', outstrings);

その他の回答 (2 件)

mohamed
mohamed 2012 年 12 月 25 日
thank you Walter you are really the best just because you care enough to look and answer :)
i tried to put ur codes but when i did the editbox i made in the GUI gone :S and on matlab i got this
Warning: Single line Edit Controls can not have multi-line text
Warning: Single line Edit Controls can not have multi-line text
Warning: Single line Edit Controls can not have multi-line text
>>
:S thank you again
  2 件のコメント
Walter Roberson
Walter Roberson 2012 年 12 月 25 日
set(handles.Editbox, 'Max', 2)
ngassa
ngassa 2013 年 3 月 26 日
HI Roberson. i am new in matlab , and i habe a problem, can you help me please i have this loop code and on matlab i get the out i want but on GUI its not working.... for i= 1:n for j = 1:k(i) output (j) = d(i,j); end disp(output) end i want any value in a box, for example , when n = 8 , i have 8 boxes , and i want one value in one box. thank you

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


mohamed
mohamed 2012 年 12 月 25 日
OMG you are the best walter thank you so much and im sorry for bothering its working :D .......
thank you again.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by