How to use XY plot for an array in simulink

9 visualizaciones (últimos 30 días)
Sreeram R
Sreeram R el 27 de Abr. de 2019
Respondida: Jesús Zambrano el 7 de Feb. de 2020
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.Array1X2000.jpg

Respuestas (1)

Jesús Zambrano
Jesús Zambrano el 7 de Feb. de 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]

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by