필터 지우기
필터 지우기

running three functions simultaneously

조회 수: 2 (최근 30일)
Aneeta Niazi
Aneeta Niazi 2011년 7월 6일
I want to run three functions simultaneously, each of which uses real time videos from two usb cameras. One program stores the video frames in a folder,the second one stores the real time feed as a video and the third one processes the real time frames.I have developed the individual functions but i want to run them simultaneously.I have searched a lot but couldn't find an appropriate solution.Please help!!!its urgent!!!
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2011년 7월 6일
You should be able to do what you want with timer functions. It won't be "Perfectly Simultaneous", but how simultaneous do you need?

댓글을 달려면 로그인하십시오.

답변 (2개)

Jan
Jan 2011년 7월 6일
Matlab runs a single thread only. So sou have to start 3 Matlab sessions.
  댓글 수: 3
Edric Ellis
Edric Ellis 2011년 7월 7일
While it's true that there's only a single user-visible thread, many MATLAB functions are multithreaded behind the scenes. When this is availalble, it's generally much more efficient than explicit thread management. Of course, that doesn't help the OP in this case where several completely separate tasks are needed simultaneously.
Jan
Jan 2011년 7월 7일
@Edric: Several threads can be started inside a Mex function. It is not necessary that all threads are finished before the Mex function returns to the caller. But these threads are not allowed to call Matlab API functions like mxCreateXYZ. And unfortunately mexCallMATLAB crashs when called from multiple threads.

댓글을 달려면 로그인하십시오.


Jason Ross
Jason Ross 2011년 7월 6일
Although it may not solve all of your problems, this thread might help you out (where Jan and Paulo have already contributed!)
  댓글 수: 1
Paulo Silva
Paulo Silva 2011년 7월 6일
Jan was right and I was wrong when we contributed to that thread, I still wish to be right because it would be useful for many projects to have just one MATLAB instance open running several functions at the same time.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by