Launch a file with a popupmenu without Switch

1 Ansicht (letzte 30 Tage)
Hugo
Hugo am 31 Jul. 2014
Bearbeitet: Hugo am 1 Aug. 2014
Hi everyone ,
i have a question about popupmenu :
rep_moteur = '.\modele\electrique';
ext_moteur = '*.m';
chemin1 = fullfile(rep_moteur,ext_moteur);
list_moteur = dir(chemin1);
set(handles.modele_2, 'String', {'',list_moteur.name})
The files are : ME_1.m and ME_2.M
i got this code to put the 2 Files from the folder in a popupmenu call : modele_2
How could i launch the file Selected ? ( it's about the String i think )
if select ME_2.M , it launch and save the variables.
ME_2
save ME_2.mat;
Thank you !

Antworten (1)

Sabarinathan Vadivelu
Sabarinathan Vadivelu am 31 Jul. 2014
Bearbeitet: Sabarinathan Vadivelu am 31 Jul. 2014
If it is a script, Just include the file name " ME_1 " in the editor window.
Like this:
str = str2double(get(handles.modele_2,'String'));
switch str
case 1
ME_1
case 2
ME_2
end
  3 Kommentare
Sabarinathan Vadivelu
Sabarinathan Vadivelu am 31 Jul. 2014
Please show your code
Hugo
Hugo am 31 Jul. 2014
Bearbeitet: Hugo am 1 Aug. 2014
It's ok i've find the solution.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by