how to plot the graph of r vs t

r=[10 20 30]
t=[40 50 60];
figure;
plot(r,t)
xlabel('r')
ylabel('t')
for the above code how to plot the graph of
  • r=10 vs t=[40 50 60]
  • r=20 vs t=[40 50 60]
  • r=30 vs t=[40 50 60]

Answers (1)

r = [10 20 30]
t = [40 50 60];
[R, T] = meshgrid(r, t);
plot(R, T)
You might possibly need ndgrid() instead of meshgrid()

3 Comments

thanks for your response.but the plot which i was expecting is x axis should be 1:10 and yaxis should be 1:40,then x axis 1:20 y axis 1:50,xaxis 1:30 y axis 1:60 separately
Okay so if you plot with those limits extracted from r and t, then what should be the line plotted in each case?
the line should be the throughput expression throughput =((Bmax.*log(1+((p_fix).*C))./noise)); u= 1:length(r) v =1:length(t) C is (u,v) and Bmax,p_fix and noise values are getting fixed.

Sign in to comment.

Asked:

on 5 Dec 2017

Community Treasure Hunt

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

Start Hunting!