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: using "eval" with strings from a cell array
Replies: 4   Last Post: Jul 22, 2013 1:14 PM

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$1@news.albasani.net>,
=?UTF-8?B?TWljaGFlbCBSwppvZXNjaA==?= <mr_78-25@web.de> 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'];
end
--
This is a Usenet signature block. Please do not quote it when replying
to one of my postings.
http://en.wikipedia.org/wiki/Signature_block



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.