Nested Loop Plots. help!

조회 수: 1 (최근 30일)
fadams18
fadams18 2019년 2월 11일
댓글: Preethi 2019년 2월 11일
Hello Matlabers,
I have 4 variables. I want to make a plot of meanERROR vs rank
SNR=[15,30,50];
MV=[0.1:0.1:0.9,0.95,0.99];
rank=2:2:20;
TestNum= 5;
meanERROR;
My code is as follows. Initially I was making a surf over 3 dimensions SNR, MV and TestNum. So for every iteration of rank, i make surf plots over the aforementioned dimension.
for kk=1:length(rank)
for l=1:length(SNR)
for k=1:length(MV)
for i=1:5
load( ['theoRRE/theo_NMF_','.mat']); % Load my ERROR data, and pick the last values and store in rRE_NMF
rRE_NMF(l,k,i)= theo_NMF1(end);
end
end
end
Mean_RRE_NMF = mean(rRE_NMF,3);
surf(MV_raw,SNRR,Median_RRE_NMF,'FaceColor',[1 0 0],'FaceAlpha',0.5)
end
Now i want to I want to see the evolution of my ERROR for Every SNR and every MV in a normal plot (not a surf) of ERROR vs rank. How do i deal with these loops.
so for example
SNR=15, MV=0.1 pot(error vs rank)
SNR=15, MV=0.1 plot(error vs rank)
.
.
SNR=15, MV=0.99 plot(error vs rank)
...
%SNR iter increases
SNR=30 MV=0.1 pot(error vs rank)
SNR=30, MV=0.1 plot(error vs rank)
SNR=30, MV=0.99 plot(error vs rank)
...
%SNR iter increases
SNR=50 MV=0.1 pot(error vs rank)
SNR=50, MV=0.1 plot(error vs rank)
.
.
SNR=50, MV=0.99 plot(error vs rank)
so for 1 iteration of SNR i have 11 plots since MV is size 1x11. in the end i want to have a 3x11=33 plots
  댓글 수: 1
Preethi
Preethi 2019년 2월 11일
if you want in different figures you cane use figure(i), chnage value of i in loop whenever you want a new graph.
or else you can have a combination of subplots() based on your groupimg

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by