finding the file names with similar strings and group them together
3 views (last 30 days)
Show older comments
In a file I have a bunch of plots which I would like to plot the one which have the same hyper-parameters (values for given variable with slightly difference between names) side by side but I don't know whether I should extract the string of file names and find hyper parameters or there is a simpler way? Here is my code
im1='beta_win_loss_1.00_win_bias_0.60_context_rigid_1_win_optimism_0.65_win_optimism_rigid_1_risk_base_2_risk_val_4_No_optimism_0.65_No_optimism_rigid_100_loss_base_3_loss_val_3.jpg';
im2='noisy_cue_beta_win_loss_1.00_win_bias_0.60_context_rigid_1_optimism_0.65_optimism_rigid_1_risk_base_2_risk_val_4_No_optimism_0.65_No_optimism_rigid_100_loss_base_3_loss_val_3.jpg';
[X1,map1]=imread(im1);
[X2,map2]=imread(im2);
p1 = [0.0 0.0 0.5 1];
p2 = [0.5 0.0 0.5 1];
subplot('Position',p1), imshow(X1,map1,'Border','tight');
subplot('Position',p2), imshow(X2,map2,'Border','tight');
set(gcf, 'PaperUnits', 'inches');
x_width=8.25 ;
y_width=11.125;
set(gcf, 'PaperPosition', [0 0 x_width y_width]); %
img='combine_noisy_cue_beta_win_loss_1.00_win_bias_0.60_context_rigid_1_optimism_0.65_optimism_rigid_1_risk_base_2_risk_val_4_NoLoss_optimism_0.65_NoLoss_optimism_rigid_100_loss_base_3_loss_val_3.png';
print(gcf,img,'-dpng','-r400');
3 Comments
Answers (0)
See Also
Categories
Find more on String Parsing 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!