Plotting a graph with X-axis different from 'time' on SIMULINK

12 views (last 30 days)
I have two scopes in the Simulink model, one giving Voltage as the output against time and the other showing Current as the output against time. Please help me in plotting Voltage and Current on the same graph, i.e, Voltage against Current.

Answers (1)

Fangjun Jiang
Fangjun Jiang on 12 Nov 2011
If you want to show Voltage vs. time and Current vs. time in one scope, click the property of the Scope block, change the "Number of axes" from 1 to 2.
If you want to show Voltage vs. Current, or vice visa, use the "XY Graph" block.
  2 Comments
Cyril CRIER
Cyril CRIER on 8 Feb 2021
Edited: Cyril CRIER on 8 Feb 2021
hello,
Quite old topic.
I try to use a "XY Graph" (Voltage vs. Current example", but I get an error because the XY Graph does accept only scalar... I wan to display 2 Array (Column Vectors).
EDIT: Hier is What I see when I look under the mask of XYGraph
And these error:
Is there a trick to correct this?
Thanks
Fangjun Jiang
Fangjun Jiang on 8 Feb 2021
Not sure what you mean by "display 2 Array (Column Vectors)".
At any one time stamp, the "XY Graph" accept two values, one for X and one for Y.
Do you mean to provode those 100 data points at 100 time stamps, e.g. 0 to 99 seconds? Open the document for "XY Graph" and look at an example.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!