Graph plot of users and subcarriers with respect to throughput
Mostrar comentarios más antiguos
N_UE=[ 10 20 30 40 50];
N_SC=[ 60 70 80 90 100];
throughput=rand(50,100);
for t=1:length(N_UE);
for r=1:length(N_SC);
e = throughput(t:r);
plot e;
hold on
end
end
how to plot the figure for the code as i am unable to get it.
Respuestas (1)
Walter Roberson
el 5 de Dic. de 2017
plot e;
means the same thing as
plot('e');
Perhaps you want
plot(e);
But I suspect that what you want is
N_UE=[ 10 20 30 40 50];
N_SC=[ 60 70 80 90 100];
num_UE = length(N_UE);
num_SC = length(N_SC);
throughput = rand(num_UE, num_SC);
surf(N_UE, N_SC, throughput, 'edgecolor', 'none);
2 comentarios
Prabha Kumaresan
el 5 de Dic. de 2017
Editada: Walter Roberson
el 5 de Dic. de 2017
Walter Roberson
el 5 de Dic. de 2017
Your requirements are hard to understand
N_UE_bounds = [10 20 30 40 50];
N_SC_bounds = [60 70 80 90 100];
num_UE = length(N_UE_bounds);
num_SC = length(N_SC_bounds);
for Uidx = 1 : num_UE
N_UE_max = N_UE_bounds(Uidx);
for Sidx = 1 : num_SC
N_SE_max = N_SE_bounds(Sidx);
for t = 1 : N_UE_max
for r = 1 : N_SE_max
throughput = rand(t, r);
e = throughput(t:r); %will often be empty...
plot(e);
hold on;
end
end
end
end
I do not understand why you bother to construct an entire random matrix and then only take linear indexes t:r out of the random matrix, especially as it would be common for t to be less than r, leading to empty data being extracted. I used t:r here because that was your requirement from https://www.mathworks.com/matlabcentral/answers/371097-plotting-the-graph-of-x-and-y-with-respect-to-z#comment_512718
You are certainly making a lot of plot calls, and the output is not going to make any sense at all.
Categorías
Más información sobre Create Plots on Maps en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!