Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Function is not defined for 'cell' inputs.
Date: Sat, 6 Jun 2009 11:22:01 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 49
Message-ID: <h0djgp$j4i$1@fred.mathworks.com>
References: <h0cq7a$mgi$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 1244287321 19602 172.30.248.37 (6 Jun 2009 11:22:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 6 Jun 2009 11:22:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:545197


"Kwon soon_mo" <contrady@gmail.com> wrote in message <h0cq7a$mgi$1@fred.mathworks.com>...
> Hi
> read the txt file
> and array... and make txt file.
> but, cell is  not make the txt file...
> 
> help me....
> 
> error>>
> 
> ??? Error using ==> fprintf
> Function is not defined for 'cell' inputs.
> 
> Error in ==> earth3 at 53
> fprintf(fid,'%s' , sort{1,3});
> 
> 
> My code>>
> 
> 
> sort{1,1} = date;
> sort{1,2} = time;
> sort{1,3} = num2cell(mega);fid = fopen('earth2.txt');
> Earth = textscan(fid,'%s %s %f %s %s %s');
> fclose(fid);
> date = Earth{1};
> time = Earth{2};
> mega = Earth{3};  %ascending power
> wi = Earth{4};
> gy = Earth{5};
> area = Earth{6};
> 
> (array....)
> 
> sort{1,1} = date;
> sort{1,2} = time;
> sort{1,3} = num2cell(mega);
> fid = fopen('earth_new.txt','wt');
> fprintf(fid,'%s', sort{1,3});
> fclose(fid);
> 
> -----------------
> use sprintf??

or maybe this FEX contribution

http://www.mathworks.com/matlabcentral/fileexchange/23840

us