필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how to extract the overwritten values inorder to plot the graph

조회 수: 1 (최근 30일)
Prabha Kumaresan
Prabha Kumaresan 2018년 4월 6일
마감: MATLAB Answer Bot 2021년 8월 20일
Could anyone tell me how to extract the overwritten values to plot the graph.
  댓글 수: 5
Prabha Kumaresan
Prabha Kumaresan 2018년 4월 6일
yes that data was different one. For the list_of_N_rng={[1,2,3,4],[5,6,7,8,9]}; the results are
Below results are for rng = 1
output1 = 1.9341e+10
Below results are for rng = 2
output1 = 1.0e+10 * 1.9341 1.6240
Below results are for rng = 3
output1 = 1.0e+10 * 1.9341 1.6240 1.9231
Below results are for rng = 4
output1 = 1.0e+10 * 1.9341 1.6240 1.9231 1.6755
Below results are for rng = 5
output1 = 1.0e+10 * 2.0917 1.6240 1.9231 1.6755
Below results are for rng = 6
output1 = 1.0e+10 * 2.0917 1.8071 1.9231 1.6755
Below results are for rng = 7
output1 = 1.0e+10 * 2.0917 1.8071 2.0985 1.6755
Below results are for rng = 8
output1 = 1.0e+10 * 2.0917 1.8071 2.0985 1.8008
Below results are for rng = 9
output1 = 1.0e+10 * 2.0917 1.8071 2.0985 1.8008 1.3841

답변 (1개)

Walter Roberson
Walter Roberson 2018년 4월 6일
You are three loops deep at the point you assign to output1(), but you only index output1 with the first and third loop variables. Everything for the second loop (seed_index) is going to be overwritten.
  댓글 수: 4
Walter Roberson
Walter Roberson 2018년 4월 6일
I am confused about what the differences are between the three different questions you have going that look to me to all be about the same topic.
Prabha Kumaresan
Prabha Kumaresan 2018년 4월 6일
Sorry to confuse.What I actually need is I want to plot the values for [1,2,3,4] and [5,6,7,8,9] separately in one graph for the following code
for t= 1:length(N_UE )
list_of_N_rng={[1,2,3,4],[5,6,7,8,9 ]};
for seed_idx = 1 : length(list_of_N_rng )
N_rng=list_of_N_rng{seed_idx };
for s=1:length(N_rng )
....
...
...
output1(t,seed_idx,s)=overall_throughput1 % final result of throughput calculation
...
...
end
end
end
dummyX = 1:length(list_of_N_rng );
figure
plot(dummyX,output1,'rs ');
hold on;grid on;
If i run the code the result which I am getting are
Below results are for rng = 1
output1 =
1.8380e+10
Below results are for rng = 2
output1(:,:,1) =
1.8380e+10
output1(:,:,2) =
2.0014e+10
Below results are for rng = 3
output1(:,:,1) =
1.8380e+10
output1(:,:,2) =
2.0014e+10
output1(:,:,3) =
1.8425e+10
Below results are for rng = 4
output1(:,:,1) =
1.8380e+10
output1(:,:,2) =
2.0014e+10
output1(:,:,3) =
1.8425e+10
output1(:,:,4) =
2.0771e+10
Below results are for rng = 5
output1(:,:,1) =
1.0e+10 *
1.8380 1.9754
output1(:,:,2) =
1.0e+10 *
2.0014 0
output1(:,:,3) =
1.0e+10 *
1.8425 0
output1(:,:,4) =
1.0e+10 *
2.0771 0
Below results are for rng = 6
output1(:,:,1) =
1.0e+10 *
1.8380 1.9754
output1(:,:,2) =
1.0e+10 *
2.0014 2.1991
output1(:,:,3) =
1.0e+10 *
1.8425 0
output1(:,:,4) =
1.0e+10 *
2.0771 0
Below results are for rng = 7
output1(:,:,1) =
1.0e+10 *
1.8380 1.9754
output1(:,:,2) =
1.0e+10 *
2.0014 2.1991
output1(:,:,3) =
1.0e+10 *
1.8425 2.0028
output1(:,:,4) =
1.0e+10 *
2.0771 0
Below results are for rng = 8
output1(:,:,1) =
1.0e+10 *
1.8380 1.9754
output1(:,:,2) =
1.0e+10 *
2.0014 2.1991
output1(:,:,3) =
1.0e+10 *
1.8425 2.0028
output1(:,:,4) =
1.0e+10 *
2.0771 2.1659
Below results are for rng = 9
output1(:,:,1) =
1.0e+10 *
1.8380 1.9754
output1(:,:,2) =
1.0e+10 *
2.0014 2.1991
output1(:,:,3) =
1.0e+10 *
1.8425 2.0028
output1(:,:,4) =
1.0e+10 *
2.0771 2.1659
output1(:,:,5) =
1.0e+10 *
0 2.1944
But I am unable to get the graph for the above result.
Could you please help me to solve it.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by