How to use XY plot for an array in simulink
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Jesús Zambrano
le 7 Fév 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 commentaires
Voir également
Catégories
En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!