필터 지우기
필터 지우기

how to use parallel programming or multi threading or multicore in matlab?

조회 수: 32 (최근 30일)
I have a program in matlab. It run in 1 hour. It is very slow!. how can I use parallel programming or multi threading or multicore in matlab? Is there any other way to improve run time?
  댓글 수: 1
Ced
Ced 2016년 4월 5일
To your actual question, the short answer is: yes, matlab can use multithreading and process things in parallel. Check out Parallel Processing in Matlab
Parallelization is not the first thing I would try though. In many cases, a huge speed up can be achieved by writing the process in an optimized form such as vectorizing operations instead of loops and conditional statements.
You can check which part of your code take up most of the time using the profiler. Just run
profile on
then run your code (or a part of it) and afterwards, call
profile viewer
This will give you a detailed description of which parts of the code are most worth optimizing.

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

채택된 답변

Walter Roberson
Walter Roberson 2016년 4월 5일
You would need the Parallel Computing Toolbox for that. It turns out that for a lot of programs, using Parallel Processing is slower rather than faster, because of the communications overhead.
A lot of the time, code can be sped up more by vectorizing and clever rewriting than by switching to Parallel Computing. But it depends on what the code does.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by