Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8789321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:22:29+00:00 2026-06-13T22:22:29+00:00

I have a function that accepts a matrix of dimension [1,2] and returns a

  • 0

I have a function that accepts a matrix of dimension [1,2] and returns a matrix of dimensions [1,136]. I also have a matrix of dimensions [N,2]. I want to apply this function to each row of the matrix to finally get a matrix of dimensions [N,136].

I am completely lost on how to do this in Matlab. A for loop solution would be enough (I can’t even do that at this point), but as far as I know in Matlab there are better and more parallelizable ways of doing things.

My current attempt looks like this:

  phi = arrayfun(@(x,y) gaussianBasis([x y])' , trainIn(:,1), trainIn(:,2), 'UniformOutput', false);

where gaussianBasis is a function returning a vector [136,1] and trainIn is a matrix [N,2]. phi is supposed to be [N,136], but this returns an array of N cell arrays each containing a matrix [1,136].

Thanks for all the help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:22:30+00:00Added an answer on June 13, 2026 at 10:22 pm

    You just need to use cat and concatenate it along the first dimension:

    phi = cat(1, phi{:})
    

    This should give you an N x 136 matrix

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function that accepts one parameter and returns a table/resultset. I want
I have a z function that accepts x and y parameters and returns a
Please suppose I have a function that accepts a pointer as a parameter. This
I have a sql function that accepts keywords and returns a full text search
I have a function in C that accepts and returns a double (and uses
I have a function that accepts File as an argument. I don't want to
I'm have a function that accepts two parameters: filter_field and filter_value. I want to
I have a basic function that accepts an Int and returns a list: generateCode
I have a function that accepts a class (not an instance) and, depending on
I have a function that accepts wildcard keyword parameters: def func(**kargs): doA doB How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.