|
"uny gg" <illinois.ks@gmail.com> wrote in message <hcquja$ht8$1@fred.mathworks.com>...
> Hello all
>
> I am trying to save the histogram image as a file.. (any format e.g. png, jpeg. etc)
> The problem is that I have to do this continuous many times..
>
> Here is may code.
>
> function dim = PatchDistHistogram(data)
> dim = size(data);
> nFeature = dim(2);
>
> for i=1:nFeature
> hist(data(:,i));
> fname = ['astro' int2str(i) '.png'];
> fname
> print fname -dpng
> end
>
> end
>
>
> When I run this code, it shows that each histogram in screen, however,
> There is no file which is created from this.
>
> I am not sure.. what is problem.
>
> Could you please somebody help me with this?
Use the functional form of print when you have a string with the filename. I think the syntax, the way you have created "fname", should be
>> print('-dpng',fname)
If that does not work, look at "help print" for the functional method syntax.
|