How to use XY plot for an array in simulink
10 views (last 30 days)
Show older comments
Hi Sir,
I am using from workspace in simulink to load an array of numbers [ V = -10:0.01:10]. I had tried a lot to plot these numbers in simulink in XY plot. But there is an error showing that it is an 1X 2000 array. Not able to plot on XY plot.Any solution please.
0 Comments
Answers (1)
Jesús Zambrano
on 7 Feb 2020
Hi Sreeman,
How to you want to plot the data from the V vector? Half of the data in X and the other hald in Y?
Note that your V vector has 1 row and 20 columns (20 signals). When using From Workspace, there are different formats to organize the data, the block describes the following:
Read data values specified in timeseries, matrix, or structure format from the MATLAB workspace, model workspace, or mask workspace.
MATLAB timeseries format may be used for any data type, complexity, or fixed dimensions. To load data for a bus signal, use a MATLAB structure that matches the bus hierarchy and specify timeseries for each leaf signal.
For matrix formats, each row of the matrix has a time stamp in the first column and a vector containing the corresponding data sample in the subsequent column(s).
For structure format, use the following kind of structure:
var.time=[TimeValues]
var.signals.values=[DataValues]
var.signals.dimensions=[DimValues]
0 Comments
See Also
Categories
Find more on Sources in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!