How can I save files (as fig and png) according to my user input? When running multiple tests.
    4 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    Luciana Noronha
 le 19 Oct 2018
  
    
    
    
    
    Commenté : Luciana Noronha
 le 19 Oct 2018
            I am testing a sensor, through GUI and MatLab is processing the data.
I have the following code to get the user input.
num_folders=input('number: ');
And this code to save the data:
 saveas(h88, [findir '/freq_respondse.png'])
    saveas(h88, [findir '/freq_respondse.fig'])
    if (sw_show_td==1)
        saveas(h11, [findir '/time_domain.png'])
        saveas(h11, [findir '/time_domain.fig'])
    end
How can I add the input as a number to fre_respondse ? so that if the user input is 15, the file name of .fig or .png will also be saved as 15, depending on the user input.
Please help.
0 commentaires
Réponse acceptée
  Walter Roberson
      
      
 le 19 Oct 2018
        outname = fullfile(findir, sprintf('freq_respondse_%d.png', num_folders) );
saveas(h88, outname);
4 commentaires
  Walter Roberson
      
      
 le 19 Oct 2018
				Get rid of your
         saveas(h11, [findir '/time_domain_%d.png', num_folders] );
and
          saveas(h11, [findir '/time_domain_%d.fig', num_folders] );
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur Fractals dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

