Can we call a class in test sequence
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Test sequence can use function declared in any mscript for example The below line works perfectly
*step_1
Stick1_Raw_Data.Stick_Main_Sensor_TRX1_Raw_Data = update_or_initialize_Stick_Raw_Data();*
function Stick_Raw_Data_Stick_Main_Sensor_TRX1_Raw_Data = update_or_initialize_Stick_Raw_Data(x,x_error,y,y_error)
% Sets the inital value or update the value
if nargin < 4
Stick_Raw_Data_Stick_Main_Sensor_TRX1_Raw_Data = struct();
Stick_Raw_Data_Stick_Main_Sensor_TRX1_Raw_Data.X = int16(0);
Stick_Raw_Data_Stick_Main_Sensor_TRX1_Raw_Data.X_Error = uint8(0);
Stick_Raw_Data_Stick_Main_Sensor_TRX1_Raw_Data.Y = int16(0);
Stick_Raw_Data_Stick_Main_Sensor_TRX1_Raw_Data.Y_Error = uint8(0);
else
Stick_Raw_Data_Stick_Main_Sensor_TRX1_Raw_Data = struct();
Stick_Raw_Data_Stick_Main_Sensor_TRX1_Raw_Data.X = int16(x);
Stick_Raw_Data_Stick_Main_Sensor_TRX1_Raw_Data.X_Error = uint8(x_error);
Stick_Raw_Data_Stick_Main_Sensor_TRX1_Raw_Data.Y = int16(y);
Stick_Raw_Data_Stick_Main_Sensor_TRX1_Raw_Data.Y_Error = uint8(y_error);
end
end
But can we also use it to declare and use a object
step_3
m = Stick_Raw_Data_Stick_Main_Sensor_TRX_Raw_Data;
%Stick1_Raw_Data.Stick_Main_Sensor_TRX1_Raw_Data = m.update(int16(23),uint8(0),int16(1500),uint8(0));
classdef Stick_Raw_Data_Stick_Main_Sensor_TRX_Raw_Data
properties
X
X_Error
Y
Y_Error
end
methods
function r = initialize(obj)
r.X = int16(0);
r.X_Error = uint8(0);
r.Y = int16(0);
r.Y_Error = uint8(0);
end
function r = update(obj,x,x_error,y,y_error)
r.X = int16(x);
r.X_Error = uint8(x_error);
r.Y = int16(y);
r.Y_Error = uint8(y_error);
end
end
end
Getting error Chart 'Test Sequence' has unresolved symbols.
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Inputs en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!