To identify the correct data object to use in your code, you need to know the name of the output signal you are interested in plotting. This signal name should be defined in your Test Manager test case.
Assuming you have already run the test case and generated simulation data, you can access the output data object using the sltestlogs object in MATLAB. Here's an example code snippet that shows how to access the data object for a signal named 'mySignal':
% Get the Test Manager test run results
logs = sltestlogs;
% Get the signal data object for 'mySignal'
out = logs.getElement('TestRun').getSignal('mySignal');
In this example, the logs object represents the entire set of test logs generated by Test Manager. We first use the getElement method to get the test run results for the most recent test run. We then use the getSignal method to get the data object for the signal named 'mySignal'.
Once you have the data object, you can plot the signal data using the plot function, similar to the example you mentioned. Here's an example code snippet that shows how to plot the signal data:
% Plot the signal data
figure;
plot(out.Values.Time, out.Values.Data);
xlabel('Time (s)');
ylabel('Signal Value');
title('My Signal');
In this example, we use the Values property of the data object to get the time and signal data. We then plot the signal data using the plot function, and add labels and a title to the plot.
I hope this helps! Let me know if you have any further questions.