Re: script callng created function within the script
- From: "M " <none@xxxxxxxx>
- Date: Wed, 3 Oct 2007 18:49:13 +0000 (UTC)
If you make your function B a separate file called
functionname.m you will not have this trouble. As far as I
know it shouldn't really slow anything down either to have
it in a separate file. Otherwise make script A a function -
functions within functions should be recognized. (you can
simply add the first line to file A of
function bogus=A()
{insert old script A and subfunction B here}
return;
I prefer the first way because it leaves your variables
accessible outside the function call which simplifies de-bugging
"Jerzy Nowakowski" <j.nowakowski@xxxxxxxx> wrote in message
<fe0jr0$bsb$1@xxxxxxxxxxxxxxxxxx>...
Hi,
within script "A" I created the function B, which then is
called using "eval" expression:
[x,resnorm] = lsqcurvefit(eval(['@'
funname]),x0,values_x,values_y,0,300,options);
I have to run the script "A" twice, because the lsqcurvefit
does not recognize the function created by the first pass.
I tried to add the line with load, like this:
load (funname);
[x,resnorm] = lsqcurvefit(eval(['@'
funname]),x0,values_x,values_y,0,300,options);
It didn't help. I still have to pass the script two times.
Thanks for help
.
- Follow-Ups:
- Re: script callng created function within the script
- From: Jerzy Nowakowski
- Re: script callng created function within the script
- References:
- script callng created function within the script
- From: Jerzy Nowakowski
- script callng created function within the script
- Prev by Date: Re: XPC target CAN I/O
- Next by Date: plotting text values
- Previous by thread: script callng created function within the script
- Next by thread: Re: script callng created function within the script
- Index(es):
Relevant Pages
|