Re: tuning a parameter in xpc target with respect to time
- From: "Arnaud Miege" <arnaud.miege@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 Mar 2009 13:13:41 -0000
"Kishore " <gudheart_ykk@xxxxxxxxx> wrote in message
news:gqiap9$t7j$1@xxxxxxxxxxxxxxxxxxxxx
Hi..
I?m trying to tune a parameter in the xpc target while the target is
running,I could tune it using the command setparam(tg,'parameter
number','parameter name')
but i wantt to vary the parameters with respect to time.when enter this
setparam command in matlab window,the parameter have a n intial value
changes suddenly to new value,but I donn?t want to change it suddenly it
should change with respect to time. from old value to new value.
For example a parameter constant is to changed from 30 to 40 with respect
to time from 0 to 100 secs.Please any can give me an example to solve it
Thanks & Regards,
Swetha
You could adopt a discretized approach, something like (note it's setparam,
not set_param):
param_values = linspace(30,40);
t_span = 100;
pause_time = t_span / length(param_values);
for k=1:length(param_values)
setparam(tg, <parameter_index>, param_values(k));
pause(pause_time);
end
This won't take exactly 100s because it ignores the communication overhead
between the host and the PC, but it shouldn't too different. You can stick
tic/toc commands to time it if you want. The issue is that although the
target operates in real-time, the host doesn't, so there is no way to
guarantee that a particular instruction on the host can be executed in
specified length of time.
HTH,
Arnaud
.
- References:
- tuning a parameter in xpc target with respect to time
- From: Kishore
- tuning a parameter in xpc target with respect to time
- Prev by Date: Re: Neural Networks
- Next by Date: crop traingular portion
- Previous by thread: tuning a parameter in xpc target with respect to time
- Next by thread: class of variable
- Index(es):
Relevant Pages
|