while loop with questdlg box
Mostrar comentarios más antiguos
Hello, I would like to know is it possible to make such a program with while loop and questdlg box, that would calculate sum of variable e.g. 'F' in each new .msi file selection:
Here is my code:
P=1;
while P>0
s=uigetfile('.msi');
a=importdata(s,' ',5);
c=[a.data];
c(1,:)=[];
c(361,:)=[];
g=getfield(a, 'textdata');
F = cellfun(@(g) str2double(g(11:end)),g(2,1));
DBD = cellfun(@(g) str2double(g(6:end-3)),g(3,1));
choice=questdlg('one more?','take or not', 'default');
switch choice
case 'Yes'
P=1;
case 'No'
P=0;
case 'cancel'
P=0;
end
end
Please suggest your ideas :)
5 comentarios
Walter Roberson
el 25 de Abr. de 2012
for P>0 would not be valid syntax. Perhaps you meant "while" instead of "for" ?
Tomas
el 25 de Abr. de 2012
Jan
el 25 de Abr. de 2012
The problem is not clear. If you add "P = 1" before the loop, the program should work. But what do you want to sum and what problems occur?
Tomas
el 25 de Abr. de 2012
Tomas
el 25 de Abr. de 2012
Respuestas (0)
Categorías
Más información sobre App Building en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!