Plotting a graph with X-axis different from 'time' on SIMULINK
조회 수: 17 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
Fangjun Jiang
2011년 11월 12일
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
Cyril CRIER
2021년 2월 8일
편집: Cyril CRIER
2021년 2월 8일
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
2021년 2월 8일
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.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!