0

I'm currently trying to compile a Matlab function into an exe file and I'm having trouble to get rid on the Inputdlg part. The original Matlab code is :

prompt={'Charge équivalente TNT :','X foyer :','Y foyer :','Z foyer :'};
title='Données'; 
answer=inputdlg(prompt,title);

Wcharge = str2double(answer{1});
Xfoyer = str2double(answer{2}); 
Yfoyer = str2double(answer{3});
Zfoyer = str2double(answer{4});

valide1 = ~ isempty(Wcharge) && Wcharge>0 && isnumeric(Wcharge);
valide2 = ~ isempty(Xfoyer) && isnumeric(Xfoyer);
valide3 = ~ isempty(Yfoyer) && isnumeric(Yfoyer);
valide4 = ~ isempty(Zfoyer) && isnumeric(Zfoyer);

check = valide1 + valide2 +valide3 + valide4;

if check < 4
disp('Données incorrectes')
return
else
end

As you now I need to get rid of the curly brackets to compile this code and I can't find an alternative to prompt={'Charge équivalente TNT :','X foyer :','Y foyer :','Z foyer :'};. Do you have any suggestion on how to proceed ?

  • What about string prompt="Charge équivalente TNT :\nX foyer :\nY foyer :\nZ foyer :"; I am not sure though what that matlab , infers. – SinisterMJ May 14 '13 at 10:24
  • Nope it didn't work but searching on doc string I've found one solution. I'using this syntax, producing the same result as earlier: S = ['Charge équivalente TNT :'; 'X foyer '; 'Y foyer ';'Z foyer ']; c = cellstr(S); title='Données'; answer=inputdlg(c,title); Thx for your answer it really put me on the right trail. – user2355178 May 14 '13 at 12:53

0 Answers0