Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to write cell data to the text file
Replies: 3   Last Post: Nov 6, 2013 3:52 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Derek Goring

Posts: 3,892
Registered: 12/7/04
Re: How to write cell data to the text file
Posted: Nov 4, 2013 1:53 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Tuesday, November 5, 2013 3:48:07 AM UTC+13, Saravanan Mani wrote:
> Hello All,
>
>
>
> I have a cell data, Please see below script. I want to write cell data in Text file. How to write?
>
>
>
> a = cell(2,2);
>
> a{1,1} = 10;
>
> a{1,2} = 20;
>
> a{2,1} = 30;
>
> a{2,2} = 40;
>
> fid = fopen('TextFile.txt','w');
>
> fwrite(fid,a);
>
> fclose(fid)
>
>
>
> I am getting below error
>
>
>
> ??? Error using ==> fwrite
>
> Cannot write value: unsupported class cell
>
>
>
> Error in ==> cell_2_text at 14
>
> fwrite(fid,a);
>
>
>
> Thanks,
>
> Saravanan


Try:
fwrite(fid,a{:});



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.