0
votes

I have constructed a simulator in Simulink that simulates the position of an object. I want to visualize the X-Y position of this object in a matlab figure.

I exported the X-Y data from Simulink to matlab using the To Workspace block. From this I get an x and y time series data out.x_pos and out.y_pos. I can plot them against time with

plot(out.x_pos)

But the following does not work to get an X-Y plot

plot(out.x_pos, out.y_pos)

What is the best way to produce this X-Y plot?

1

1 Answers

0
votes

Since no one helped me, I will present what I came up with after eventually reaching the right pages on the MATLAB documentation.

The To Workspace block exports the data as a timeseries object. This object has the values of the signal as a property called Data. To access the property one writes <object>.Data, so to obtain the desired X-Y plot one writes

plot(out.x_pos.Data, out.y_pos.Data)