listdlg, giving memory to list dialog from previous execution.

Hi,
I am using a list dialog in my code, allowing user to select the desired items. I want to introduce some kind of memory to the list dialog so that it remember the previously selected items.
Right now i am using following code for the list dialog. For example
r = {'Crunchy','Creamy','Natural','Chocolate'};
[Selection,ok] = listdlg('ListString',r);
for i = 1 : length(Selection)
some operation...
end
In above example if user has selected Crunchy and Creamy Then i want that next time "Crunchy" and "Creamy" should be pre-selected in the list dialog.
Thanks in advance for your suggestions, tips and hints.
Kind regards, \\ Arsalan

 採用された回答

Matt Tearle
Matt Tearle 2011 年 3 月 16 日

1 投票

Will this do what you want?
r = {'Crunchy','Creamy','Natural','Chocolate'};
Selection=[];
for k=1:3
[Selection,ok] = listdlg('ListString',r,'InitialValue',Selection);
% Do more stuff
end

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeApp Building についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by