|
Hello Michael,
In that case you maybe need to introduce time as a variable in your
computations without being bothered what the actual computational
times are. Then, you just have to make sure that your model and
constants are physically correct. When that is the case you sample
at a constant interval of your time variable in the program.
Pieter.
"michael" <bezenchu@gmail.com> wrote in message <i8mdhs$qfs$1@fred.mathworks.com>...
> but when i do the pause, i can't do other calculations
> for example - i wanna calculate speed of rotation of car wheel:
> each second there is sampling.
> after the taking some sample till next sample there should be time (less then second because the duration of the taking the sample) in which i want to do some calculations.
> according your proposal - i can't
>
> "Pieter Chys" <pieter@cib.csic.es> wrote in message <i89lge$orq$1@fred.mathworks.com>...
> > Hello Michael,
> >
> > You could use:
> >
> > pause on
> > for i = 1:n
> > pause(n)
> > your simulation function....
> >
> > end
> >
> > with n a nonnegative real number (when the time
> > interval is not too small because for high resolution
> > there can be high relative error). If exactness is
> > important at small time scales you should check out
> > info on 'time and date operations' at Mathworks
> > Matlab info pages. It is certainly possible.
> >
> > Regards,
> > Pieter Chys.
> >
> > "michael" <bezenchu@gmail.com> wrote in message <i7vrd1$njl$1@fred.mathworks.com>...
> > > hello
> > >
> > > for my simulation, i need to do timing - a function to run on constant time delays, no matter what (for example during the simulation, the program should do measurements on constant time interval, meanwhile it do some calculation on the measurments)
> > > how do i do it?
|