For Programmers: Free Programming Magazines  


Home > Archive > Matlab > April 2005 > waitbar misbehaves in compiled function









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author waitbar misbehaves in compiled function
Phill Jones

2005-04-21, 4:03 pm

Here's my simple implementation of a waitbar in a fitting routine
I've written:

pb=waitbar(0,'Fitting: please wait');
for i=1:length(pos)
[params_out(:,i) chi2(i)
tmin(i)]=curve_fit(t,data,posi(i),posj(i
),params_in,switches,linkswitc
h);
figure(pb)
waitbar(i/length(pos),pb);
end
close(pb)

curve_fit, in case you were wondering, is a wrapper arround
fminsearch that allows me to select which parameters I'm fixing and
which I'm allowing to be fit.

It works fine when I'm just running it in Matlab but if I compile the
programme with this command:

mcc fliper multi_exp.m -v -B sgl

the waitbar behaves oddly, like it main programme is calling it but
not waiting for it to initialise and it won't update or show the
progress.

I'm probably doing something stupid but I can't tell what because it
doesn't generate an error and it works in it's non-compiled version.

Cheers,
Phill
Phill Jones

2005-04-21, 4:03 pm

Just to make life easier, I wrote this simple programme to illustrate
the point, it doesn't need any extra functions

function waitbar_test

a=rand(200,200);
b=rand(200,200);
h=waitbar(0,'test');

for i=1:100
b/a;
waitbar(i/100,h)
i
end
close(h)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com