Collect and plot data and legend depending on folder name

1 view (last 30 days)
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 Comment
Nik Rocky
Nik Rocky on 23 Jun 2020
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?

Sign in to comment.

Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!