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 convert nonuniform cell to uniform matrix?
Replies: 3   Last Post: Apr 1, 2013 7:30 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Greg Heath

Posts: 5,964
Registered: 12/7/04
How to convert nonuniform cell to uniform matrix?
Posted: Mar 31, 2013 8:20 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have a 10x15 cell named stopcrit0 with character elements
of different lengths:

'Validation stop.'
'Minimum gradient reached.'
'Performance goal met.'

I would like to replace it with a corresponding 10x15 character
matrix named stopcrit with elements of length 7:

'valstop'
'mingrad'
'perfmet'

The majority of the elements will be 'Valstop.'. Therefore,
my plan was to initialize stopcrit with 'valstop' and then loop
through stopcrit0 elementwise to replace 'valstop' in stopcrit
where indicated.

Or is it better to make the changes to the cell and then convert
it to a matrix?

What is the best way to do this? I would appreciate code.

TIA

Greg



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.