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: Vectorize a cell array
Replies: 1   Last Post: Jul 25, 2011 12:37 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jesse Sipple

Posts: 8
Registered: 7/21/11
Vectorize a cell array
Posted: Jul 25, 2011 11:00 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello! (this is a 2 part-er)

I'm currently working on a minimization problem that I start out with several vectors that are the same size, then I remove data points from each of the vectors depending on the coherence (that part doesn't really matter) so in the end I end up with let's say 4 vectors of different lengths that I want to combine and run the minimization on.

My goal is to keep each of these vectors separate (for purposes of plotting later and checking my data) so I've started to use cell arrays. Currently I have a cell array that's 1x4 and has elements {506x1}, {385x1}, {248x1}, {247x1} and I want to find a way that I can turn it from the cell array in that configuration to a vector that would be (1413x1) that I can run my minimization on. Does anyone know how to efficiently do this? I feel like I could do it with a series of loops but there must be a quicker way to do it.

Also, my final goal is to then repopulate my cell arrays with 0's where the points I previously removed data from for plotting and I've looked around on how to do that and found "cellfun" but according to the documentation it would have to be the same size as the original, again any help on how to do this efficiently would be greatly appreciated! Thanks!

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.