<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/253009</link>
    <title>MATLAB Central Newsreader - Function is not defined for 'cell' inputs.</title>
    <description>Feed for thread: Function is not defined for 'cell' inputs.</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sat, 06 Jun 2009 04:10:18 -0400</pubDate>
      <title>Function is not defined for 'cell' inputs.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/253009#655006</link>
      <author>Kwon soon_mo</author>
      <description>Hi&lt;br&gt;
read the txt file&lt;br&gt;
and array... and make txt file.&lt;br&gt;
but, cell is  not make the txt file...&lt;br&gt;
&lt;br&gt;
help me....&lt;br&gt;
&lt;br&gt;
error&amp;gt;&amp;gt;&lt;br&gt;
&lt;br&gt;
??? Error using ==&amp;gt; fprintf&lt;br&gt;
Function is not defined for 'cell' inputs.&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; earth3 at 53&lt;br&gt;
fprintf(fid,'%s' , sort{1,3});&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
My code&amp;gt;&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
sort{1,1} = date;&lt;br&gt;
sort{1,2} = time;&lt;br&gt;
sort{1,3} = num2cell(mega);fid = fopen('earth2.txt');&lt;br&gt;
Earth = textscan(fid,'%s %s %f %s %s %s');&lt;br&gt;
fclose(fid);&lt;br&gt;
date = Earth{1};&lt;br&gt;
time = Earth{2};&lt;br&gt;
mega = Earth{3};  %ascending power&lt;br&gt;
wi = Earth{4};&lt;br&gt;
gy = Earth{5};&lt;br&gt;
area = Earth{6};&lt;br&gt;
&lt;br&gt;
(array....)&lt;br&gt;
&lt;br&gt;
sort{1,1} = date;&lt;br&gt;
sort{1,2} = time;&lt;br&gt;
sort{1,3} = num2cell(mega);&lt;br&gt;
fid = fopen('earth_new.txt','wt');&lt;br&gt;
fprintf(fid,'%s', sort{1,3});&lt;br&gt;
fclose(fid);&lt;br&gt;
&lt;br&gt;
-----------------&lt;br&gt;
use sprintf??</description>
    </item>
    <item>
      <pubDate>Sat, 06 Jun 2009 08:38:01 -0400</pubDate>
      <title>Re: Function is not defined for 'cell' inputs.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/253009#655030</link>
      <author>Sadik </author>
      <description>Hi Kwon,&lt;br&gt;
&lt;br&gt;
In this line:&lt;br&gt;
&lt;br&gt;
sort{1,3} = num2cell(mega);&lt;br&gt;
&lt;br&gt;
you are assigning a cell to sort{1,3}, but in your fprintf, you are writing it as a string by saying %s. This is why you get the error. If mega is of type double, then you could say something like:&lt;br&gt;
&lt;br&gt;
fprintf(fid,'%6.4f',mega);&lt;br&gt;
&lt;br&gt;
If it is an integer, then&lt;br&gt;
&lt;br&gt;
fprintf(fid,'%d',mega);&lt;br&gt;
&lt;br&gt;
which all mean that you can directly input your variable. You should only be careful about what you put after the percent sign.&lt;br&gt;
&lt;br&gt;
&quot;Kwon soon_mo&quot; &amp;lt;contrady@gmail.com&amp;gt; wrote in message &amp;lt;h0cq7a$mgi$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi&lt;br&gt;
&amp;gt; read the txt file&lt;br&gt;
&amp;gt; and array... and make txt file.&lt;br&gt;
&amp;gt; but, cell is  not make the txt file...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; help me....&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; error&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ??? Error using ==&amp;gt; fprintf&lt;br&gt;
&amp;gt; Function is not defined for 'cell' inputs.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Error in ==&amp;gt; earth3 at 53&lt;br&gt;
&amp;gt; fprintf(fid,'%s' , sort{1,3});&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; My code&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; sort{1,1} = date;&lt;br&gt;
&amp;gt; sort{1,2} = time;&lt;br&gt;
&amp;gt; sort{1,3} = num2cell(mega);fid = fopen('earth2.txt');&lt;br&gt;
&amp;gt; Earth = textscan(fid,'%s %s %f %s %s %s');&lt;br&gt;
&amp;gt; fclose(fid);&lt;br&gt;
&amp;gt; date = Earth{1};&lt;br&gt;
&amp;gt; time = Earth{2};&lt;br&gt;
&amp;gt; mega = Earth{3};  %ascending power&lt;br&gt;
&amp;gt; wi = Earth{4};&lt;br&gt;
&amp;gt; gy = Earth{5};&lt;br&gt;
&amp;gt; area = Earth{6};&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; (array....)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; sort{1,1} = date;&lt;br&gt;
&amp;gt; sort{1,2} = time;&lt;br&gt;
&amp;gt; sort{1,3} = num2cell(mega);&lt;br&gt;
&amp;gt; fid = fopen('earth_new.txt','wt');&lt;br&gt;
&amp;gt; fprintf(fid,'%s', sort{1,3});&lt;br&gt;
&amp;gt; fclose(fid);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -----------------&lt;br&gt;
&amp;gt; use sprintf??</description>
    </item>
    <item>
      <pubDate>Sat, 06 Jun 2009 11:22:01 -0400</pubDate>
      <title>Re: Function is not defined for 'cell' inputs.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/253009#655052</link>
      <author>us</author>
      <description>&quot;Kwon soon_mo&quot; &amp;lt;contrady@gmail.com&amp;gt; wrote in message &amp;lt;h0cq7a$mgi$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi&lt;br&gt;
&amp;gt; read the txt file&lt;br&gt;
&amp;gt; and array... and make txt file.&lt;br&gt;
&amp;gt; but, cell is  not make the txt file...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; help me....&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; error&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ??? Error using ==&amp;gt; fprintf&lt;br&gt;
&amp;gt; Function is not defined for 'cell' inputs.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Error in ==&amp;gt; earth3 at 53&lt;br&gt;
&amp;gt; fprintf(fid,'%s' , sort{1,3});&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; My code&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; sort{1,1} = date;&lt;br&gt;
&amp;gt; sort{1,2} = time;&lt;br&gt;
&amp;gt; sort{1,3} = num2cell(mega);fid = fopen('earth2.txt');&lt;br&gt;
&amp;gt; Earth = textscan(fid,'%s %s %f %s %s %s');&lt;br&gt;
&amp;gt; fclose(fid);&lt;br&gt;
&amp;gt; date = Earth{1};&lt;br&gt;
&amp;gt; time = Earth{2};&lt;br&gt;
&amp;gt; mega = Earth{3};  %ascending power&lt;br&gt;
&amp;gt; wi = Earth{4};&lt;br&gt;
&amp;gt; gy = Earth{5};&lt;br&gt;
&amp;gt; area = Earth{6};&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; (array....)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; sort{1,1} = date;&lt;br&gt;
&amp;gt; sort{1,2} = time;&lt;br&gt;
&amp;gt; sort{1,3} = num2cell(mega);&lt;br&gt;
&amp;gt; fid = fopen('earth_new.txt','wt');&lt;br&gt;
&amp;gt; fprintf(fid,'%s', sort{1,3});&lt;br&gt;
&amp;gt; fclose(fid);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -----------------&lt;br&gt;
&amp;gt; use sprintf??&lt;br&gt;
&lt;br&gt;
or maybe this FEX contribution&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/23840&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/23840&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
us</description>
    </item>
  </channel>
</rss>

