Thursday 8 December 2011

Matlab Save the Figure Window Example Code | Saveas Function For Save the Figure in Matlab

Matlab is one of research toolbox,It contain large amount of Tools.Some times you want to save the figure file at that situation it mainly helpful.Matlab different way to save the figures.We give one of the option to save the figure in run time.We use saveas function for save the figure window.This way most helpful for save the figure.Please use following operation for save the figures in matlab.
  1. In figure window must use the handle object.ex (h1 = figure;plot(x,y));
  2. Then this handle object save in your work space using saveas function.
This saveas function contain three major Parameters.
  1. Handle object
  2. Name of the fileName
  3. Final parameter is Filename type, like(Jpeg,Png,Tiff);
Syntax as follows
saveas(handle,'filename','filetype')

Example code and output as follows
>> x = rand(10,1);
>> y = rand(10,1);
>> h1 = figure;plot(x,y);
>> saveas(h1,'my_figure','jpg');

output is



Kindly Bookmark and Share it:

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...