From: Pete on 25 Mar 2010 16:09 allvalues = get(handles.popupmenu1,'String'); choiceidx = get(handles.popupmenu1,'Value'); if iscell(allvalues) choicestr = allvalues{choiceidx}; else choicestr = allvalues(choiceidx,:); end choice = str2double(choicestr); set_param('untitled/Constant','Value',choicestr); The string for my pop up menu is: FGH9 FGH7 These are model numbers of a product which have a certain speed. I want the speed to load into the consant but the model number loads instead!! How do i fix this?
From: Pete on 25 Mar 2010 16:46 "Pete " <peterclark(a)hotmail.com> wrote in message <hogft0$7jg$1(a)fred.mathworks.com>... > allvalues = get(handles.popupmenu1,'String'); > choiceidx = get(handles.popupmenu1,'Value'); > > if iscell(allvalues) > choicestr = allvalues{choiceidx}; > else > choicestr = allvalues(choiceidx,:); > end > choice = str2double(choicestr); > set_param('untitled/Constant','Value',choicestr); > > > The string for my pop up menu is: > FGH9 > FGH7 > > These are model numbers of a product which have a certain speed. I want the speed to load into the consant but the model number loads instead!! How do i fix this? i am refering to my model in simulink
|
Pages: 1 Prev: who can explain this coding? Next: Remove a row if the vector in that row is 0 |