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 8220519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:32:47+00:00 2026-06-07T13:32:47+00:00

I am trying to to some computations and I would like to do it

  • 0

I am trying to to some computations and I would like to do it in parallel using parfor or by Opening the matlabpool.. as the current implementations is too slow:

result=zeros(25,16000);
for i = 1:length(vector1) % length is 25

     for j = 1:length(vector2) % length is 16000 

              temp1 = vector1(i); 
              temp2 = vector2(j);
              t1 = load(matfiles1(temp1).name) %load image1 from matfile1
              t2 = load(matfiles2(temp2).name) % load image2 from matfile2
              result(i,j)=t1.*t2
    end
end

its works fine but I would really like to know if there is a way to speed thing up …
Thanks a lot in advance!

  • 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-07T13:32:49+00:00Added an answer on June 7, 2026 at 1:32 pm

    Using a parfor loop and opening a matlabpool go together. Opening the matlabpool provides your MATLAB session with dedicated workers with which it can run the body of your parfor loop. So, you could change your code to something like this:

    matlabpool open local 4 % or however many cores you have
    parfor i = ...
       ...
    end
    

    Before running your code in parallel, I would definitely recommend using the MATLAB profiler to ensure you understand where the time is being spent running your code. (I’m a little surprised that hoisting the load into t1 into the outer loop has no effect – the profiler presumably should therefore show that the load calls take very little time compared to the rest of your algorithm).

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

Sidebar

Related Questions

I am trying to accelerate some computations using OpenCL and part of the algorithm
I am trying to do some computations using Laplace transforms in R. I used
I am trying to do some computations using the multiprocessing module in python 2.7.2.
I'm using Eclipse with C++ plugins on my macbook, trying some practice projects to
I would like to know if maybe there are some good solutions to handling
I'm trying to do some parsing that will be easier using regular expressions. The
I am trying to perform some computations on a server. For this, the client
I'm trying to understand some of the basics of using POSIX pthreads. The kind
I'm trying to do some computations on date, I have a timedelta object, and
I'm trying some iOS test applications on the new Mac mini, that supports Bluetooth

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.