
Re: How to apply a function to the columns of a matrix
Posted:
Dec 24, 2011 4:08 PM


On Dec 24, 6:52 am, "Matt J " <mattjacREM...@THISieee.spam> wrote: > Aseman <andali...@gmail.com> wrote in message <1252972073f9471f99dce64e452f7...@b20g2000pro.googlegroups.com>... > > On Dec 24, 1:24 am, "Matt J " <mattjacREM...@THISieee.spam> wrote: > > > Aseman <andali...@gmail.com> wrote in message <71c2925ead3a430fb9b318453386c...@t8g2000yqg.googlegroups.com>... > > > > hi > > > > > I should apply my own function fun to the columns of a matrix > > > > A(200,000 by 1000). How to do this without cellfun or for loops? > > > > any help will be greatly appreciated. > > > > =============== > > > > What's the function? > > > Dear Matt > > This is actually the problem my colleague, Rahill, seek advice about > > it. You kindly answered to his question in her past post. Your code > > works more faster on each column of the matrix consisting of 180,000 > > elements, but how we could run it over all 744 columns without any for > > loop? > > ============== > > I don't really understand what you mean by "your code works faster on each column". The code that I gave is not isolated to a particular column, nor does it contain any forloops. It generated the entire A_segmented matrix in a single command. The only homework exercise that I left is to generalize the command to larger matrix sizes.
Dear Matt Thanks for your comment. I am so sorry that I was not clear enough. The matrix A, in my example is the reshaped form of just one column of a primary matrix, say X, which includes 744 columns. Thanks to the code you provided, we can now do the job without reshaping each column. But, in the second step, we should apply the code to the entire X column by column. please let me note that we finally should apply a FFT function to the columns of X.

