Collect and plot data and legend depending on folder name

조회 수: 1 (최근 30일)
Nik Rocky
Nik Rocky 2020년 6월 23일
댓글: Nik Rocky 2020년 6월 23일
Hello together,
I have multiple data that will be analyzed with TP-Rate and FD-Rate and plot this to ROC curve.
I want to compare data with this principle (german):
(I want to compare datasets from fifferent motors with two microphones and two distances, and three measure scenario)
My folder Strukture is here:
At the moment I get this graph:
I want to have graphs like this:
or this
So, I want to collect a foldername from Motor_Set_x to 2-3 subfolder and print it in legend to compare data from first and second folder.
Here is my code:
for loop with k calculations
end
labels = (1:k);
figure('Name',' receiver operating characteristic','NumberTitle','on');
hold on
p11 = plot(M(:,2),M(:,1),'ro','Color','g'); %Here I can randomize a colors
buffer = [.1 .3 .5];
buffer = repmat(buffer,1,ceil(numel(M(:,2))/numel(buffer)));
buffer(numel(M(:,2))+1:end) = [];
[~, ySortIdx] = sort(M(:,2));
buffer(ySortIdx) = buffer;
labelpoints(M(:,2),M(:,1), name_save, 'E', buffer)
hold on
help_x = 0:0.1:1;
help_y = 0:0.1:1;
plot(help_x,help_y,'--');
xlabel('False discovery rate')
ylabel('True positive rate')
xlim([0 1]);
ylim([0 1]);
lgd = legend([p11],'Result','Location','east');
title(lgd,'n = Measure number')
tube_size_help = sprintf('%.0f',tube_size);
nameX=strcat(name ,'_tube_size_',tube_size_help);
saveas(gcf, 'result_F0_detection_1M.png')
save 'result.mat' M
Do you have some idea? Thank you!
  댓글 수: 1
Nik Rocky
Nik Rocky 2020년 6월 23일
While for loop I use a variable FilePath that looks everytime like this:
/home/user/workspace/QT/Software_2.0_QT/IO/Motor_Set_1/AKG_C1000S/Distance_0.5m/Scenario_M2/004_m1_m4_60_const_20200611_200711/
maybe it an be useful to extract foldernames?

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by