From: Pete on
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
"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