How to use XY plot for an array in simulink

조회 수: 10 (최근 30일)
Sreeram R
Sreeram R 2019년 4월 27일
답변: Jesús Zambrano 2020년 2월 7일
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

답변 (1개)

Jesús Zambrano
Jesús Zambrano 2020년 2월 7일
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]

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by