[Help] Matlab executes the program very slowly (Slow execution)

I am working on code on matlab which basically consist of for loops and matrices values i.e. image processing but it takes around 2 3 minutes to execute the code while the same code runs faster on my other laptop, please help

5 件のコメント

Philip Borghesani
Philip Borghesani 2017 年 3 月 21 日
Are you using the same version of matlab on the same os? What processors do the machines have? Post some example code or tell us what code is taking the time by using the profiler. Looping over images by pixel is slow, see if you can vectorize the code to loop over columns at a minimum.
akash bais
akash bais 2017 年 3 月 21 日
akash bais
akash bais 2017 年 3 月 21 日
I have Core i7 processor, 8gb ram, 2gb graphics,
Adam
Adam 2017 年 3 月 21 日
That definitely looks suspiciously like for loops. The fact that almost no function is registering at all as significant apart from 'trial' for which 'Self Time' is basically the entire time of the program suggests that you are doing something extremely slow with code that has nothing to do with functions of any other kind.
akash bais
akash bais 2017 年 3 月 21 日
the same program gets executed on my other laptop within no time its just with my pc that i am facing issues

サインインしてコメントする。

回答 (1 件)

ES
ES 2017 年 3 月 21 日
編集済み: Jan 2017 年 3 月 21 日

0 投票

11 件のコメント

akash bais
akash bais 2017 年 3 月 21 日
How to use it? I mean if i find the execution time what deductions will i be able to make
akash bais
akash bais 2017 年 3 月 21 日
see this
Jan
Jan 2017 年 3 月 21 日
@Chocolate: If you inlcude links in < and > it is clickable.
@akash: Please follow the link of Chocolate, because it is the documentation of the needed command. Everything you need is explained there.
Adam
Adam 2017 年 3 月 21 日
編集済み: Adam 2017 年 3 月 21 日
Even better, just
doc profile
should give you your local help. I'm not aware of major changes in the profiler in recent versions, but if you aren't running the latest Matlab you are better looking at your local help than the latest help which may not be valid for your version.
Unless for some reason you don't have local help installed.
akash bais
akash bais 2017 年 3 月 21 日
akash bais
akash bais 2017 年 3 月 21 日
SEE THIS it take 300 seconds to execute
Jan
Jan 2017 年 3 月 21 日
The main work is done inside the function "trial". No click on this underlines link and examine, which lines takes the most time.
akash bais
akash bais 2017 年 3 月 21 日
trail is the name of the code that is saved in directory
Jan
Jan 2017 年 3 月 21 日
編集済み: Jan 2017 年 3 月 21 日
Please proceed with the examination of the profiler protocol. Currently you see the main page only. Click on the functions until you found the line or code block, which uses the most of the run time. Then post this part to get further help.
akash bais
akash bais 2017 年 3 月 22 日
the code part which it is showing is not in my code i mean they are some internal functions
Adam
Adam 2017 年 3 月 22 日
We still can't help in any way if we have no more information than that something inside 'trail' is very slow.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

質問済み:

2017 年 3 月 21 日

コメント済み:

2017 年 3 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by