The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: using "eval" with strings from a cell array
Replies: 6   Last Post: Nov 29, 2016 11:43 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Walter Roberson

Posts: 5,173
Registered: 2/26/06
Re: using "eval" with strings from a cell array
Posted: Jan 31, 2008 8:49 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

In article <fntspc$v38$>,
=?UTF-8?B?TWljaGFlbCBSwppvZXNjaA==?= <> wrote:

>eval('string' cell_array(1))

>returns these error:

>Undefined function or method 'eval' for input arguments of type 'cell'

>Any ideas how to change a single cell to a ordinary string?

cell_array{1} instead of cell_array(1)

>But I'm not able to access these filenames with the eval function to
>alter them before saving again.

It seems unlikely to me that you need to use eval to do what
you want to do. For example, if you wanted to change the extension
on each filename to 'xls', you could use

for K=1:length(cell_array)
cell_array{K} = [cell_array{K}(1:end-3) 'xls'];
This is a Usenet signature block. Please do not quote it when replying
to one of my postings.

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.