Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: help to save file from histogram
Date: Wed, 4 Nov 2009 04:06:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 27
Message-ID: <hcquja$ht8$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257307562 18344 172.30.248.37 (4 Nov 2009 04:06:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 4 Nov 2009 04:06:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1924470
Xref: news.mathworks.com comp.soft-sys.matlab:582232


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?