Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Function is not defined for 'cell' inputs.
Date: Sat, 6 Jun 2009 04:10:18 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 42
Message-ID: <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 1244261418 23058 172.30.248.37 (6 Jun 2009 04:10:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 6 Jun 2009 04:10:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1867754
Xref: news.mathworks.com comp.soft-sys.matlab:545151

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??