Plotting two vectors as a function of each other

조회 수: 35 (최근 30일)
Michael Dilmore
Michael Dilmore 2020년 9월 21일
답변: Mayank Bajpai 2020년 10월 28일
Hi all
I have two vectors representing the throughput and delay of a wireless network link, both plotted as a function of the applied load given as the number of competing stations present from 1 to N = 100 (where N = the maximum considered number of stations and the length of each vector).
What I want to do is plot the throughput as a function of the delay - how can I do this?
I've come across the function plotxy() which sounds like it does what I need but this uses the simscape toolbox, which I'm not using for the project.
  댓글 수: 1
Akira Agata
Akira Agata 2020년 9월 22일
If your two vectors have the same size (e.g 1-by-N), I would recommend simply applying plot function.
If possible, could you upload your data (or share a small example) ?

댓글을 달려면 로그인하십시오.

답변 (1개)

Mayank Bajpai
Mayank Bajpai 2020년 10월 28일
I think, you have two simple options:
  1. use the scatter plot. i.e scatter(x,y)
  2. sort the data and then use plot. i.e
temp = sortrows([x y]); % assuming x and y are row vector.
plot(temp(:,1),temp(:,2))

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by