Undefined function or variable 'start'.
Function 'Real Time States' (#127.903.911), line 34, column
5:
"start(t)"
Undefined function or variable 'wait'.
Function 'Real Time States' (#127.917.924), line 35, column
5:
"wait(t)"
Function call failed.
Function 'Real Time States' (#127.494.512), line 14, column
5:
"myWait(GPS_Period)"
Undefined function or variable 'start'.
Function 'Real Time States' (#127.903.911), line 34, column
5:
"start(t)"
Undefined function or variable 'wait'.
Function 'Real Time States' (#127.917.924), line 35, column
5:
"wait(t)"
Function call failed.
Function 'Real Time States' (#127.608.626), line 20, column
5:
"myWait(IMU_Period)"
Errors occurred during parsing of Embedded MATLAB
function 'Real Time States'(#127)
Function 'timer' implicitly resolved in the MATLAB
workspace.
This feature is deprecated.
Please declare this function extrinsic using eml.extrinsic
('timer'), or call it using feval.
Function 'Real Time States' (#127.848.897), line 33, column
7:
"timer('timerfcn','myWait(0)','StartDelay',DeltaT)"
Function 'timer' implicitly resolved in the MATLAB
workspace.
This feature is deprecated.
Please declare this function extrinsic using eml.extrinsic
('timer'), or call it using feval.
Function 'Real Time States' (#127.848.897), line 33, column
7:
"timer('timerfcn','myWait(0)','StartDelay',DeltaT)"
Here is the code from my Embedded Matlab file:
function
[E_GPS,N_GPS,heading_IMU,speed_Hall,speed_GPS,Time_GPS,Time_
IMU] = RealTimeStates(E,N,heading,speed)
%% Adjust state values so they are input at same
frequencies as real system
% Initialise GPS,IMU and Hall-Effect Sensor timestamps
Time_GPS = 0;
Time_IMU = 0;
% Define GPS, IMU and Hall-Effect Sensor periods for data
input
GPS_Period = 0.1; % 10Hz
IMU_Period = 0.02; % Approx 50Hz
% Update GPS time stamp at 10 Hz
for i = 1:100
myWait(GPS_Period)
Time_GPS = Time_GPS + 1;
end
% Update IMU time stamp at 50 Hz
for i = 1:10/IMU_Period
myWait(IMU_Period)
Time_IMU = Time_IMU + 1;
end
E_GPS = E;
N_GPS = N;
heading_IMU = heading;
speed_Hall = speed;
speed_GPS = speed;
% Waits for the specified number of seconds
function myWait(DeltaT)
if(DeltaT>0) %end condition
t=timer('timerfcn','myWait(0)','StartDelay',DeltaT);
start(t);
wait(t);
end
Any ideas?
"Brendan " <cheese...@hotmail.com> wrote in message
<g51m11$8bn$1...@fred.mathworks.com>...
I'd try making myWait extrinsic. Just declare it
eml.extrinsic('myWait');
at the top of RealTimeStats, and move the definition of myWait into a
myWait.m in the same directory as the model or somewhere else on the MATLAB
path. That way, Embedded MATLAB will just make a mex call into MATLAB to
call myWait, supplying the deltaT parameter.
--
Mike
"Brendan " <cheese...@hotmail.com> wrote in message
news:g56alt$2c2$1...@fred.mathworks.com...