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

  • Home
  • SEARCH
  • 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 746841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:08:13+00:00 2026-05-14T14:08:13+00:00

I am writing a C# application and I would like to make calls to

  • 0

I am writing a C# application and I would like to make calls to different matlab functions simultaneously(from different threads). Each Matlab function is located in its own compiled .net library. It seems that I am only able to call one Matlab function at a time however.

ie, if matlab_func1() gets called from thread1 then matlab_func2() gets called from thread2, matlab_func2() must wait for matlab_func1() to finish executing.

Is there a way to call different matlab functions simultaneously? Thanks.

 MWArray[] DoKalmanFilter(double vel_x, double vel_y, double vel_z, double cal_x, double cal_y, double cal_z, bool doCal)
  {
     ...set up parameters       

     ret = KalmanFilter.kalman_actual(6, velx, vely, velz, cal_x, cal_y, cal_z, 
     return ret;
  }

  private void DoImageProcessing()
  {
       ..set up parameters
      MWArray[] ret = _imgProcessor.DoImageProcessing(2, rgbMarkerColor, hsvThreshold, angleDiffThreshold);
  }
  • 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-05-14T14:08:13+00:00Added an answer on May 14, 2026 at 2:08 pm

    I would suggest that when you call your functions, MATLAB (or MATLAB’s real time workshop that gets embedded in to a DLL) is spawned and the function is run. The MATLAB interface between C# and C likely has a few global external variables, and as a result MATLAB probably can’t be spawned twice within the same process. Also, MATLAB itself is in many ways single threaded. They are working on moving towards more use of multi-core.

    I have used the Java/Matlab interface before, and read on this site the following:
    Matlab is single-threaded. This means that if you try to eval or feval from within a Java function that was called directly from a Matlab function, it will hang waiting for the first matlab function to terminate.

    What I might suggest as a test is to put “DoKalmanFilter” and “DoImageProcessing” in to seperate assemblies or applications, and then make an application that spawns your two new seperate applications. This way you get two processes and MATLAB will run once inside each process giving you the ability to run your functions simultaneously.

    If that works, you can then start thinking of ways around this. You dont want to have to be spawning applications and closing them down all the time. You might need to use some inter-process communication between your processes to pass data around, it might get ugly 🙂

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

Sidebar

Related Questions

I am writing an application and I would like to be able to display
I am writing a C++ application and would like to request several data files
I'm writing my Servlet application and would like to use the following static method
I'm writing a very Simple Chat Application and would like to know how to
In Android I am writing an application in which, I would like to capture
Im writing a server based application and i would like eclipse to be able
I'm writing a shopping car application and I would like visitors (i.e. people not
I'm writing a small application in VB.NET and I would like some of the
I am currently writing my truly first PHP Application and i would like to
There I am writing a Python application on win7. I would like to display/access

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.