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 apply a function to the columns of a matrix
Replies: 9   Last Post: Dec 25, 2011 2:10 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
andalibar@gmail.com

Posts: 17
Registered: 2/28/07
Re: How to apply a function to the columns of a matrix
Posted: Dec 24, 2011 4:08 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Dec 24, 6:52 am, "Matt J " <mattjacREM...@THISieee.spam> wrote:
> Aseman <andali...@gmail.com> wrote in message <12529720-73f9-471f-99dc-e64e452f7...@b20g2000pro.googlegroups.com>...
> > On Dec 24, 1:24 am, "Matt J " <mattjacREM...@THISieee.spam> wrote:
> > > Aseman <andali...@gmail.com> wrote in message <71c2925e-ad3a-430f-b9b3-18453386c...@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 for-loops. 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.



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.