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: 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: 6,387
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:


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.



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.