problem with matlab when executing the same program twice?

i seem to be facing this weird problem when i try to run the same program in matlab, in succession. the first time i do it it gives me the answer within 30 seconds, and then when i try to run it again it just goes on and on. how is this possible? i have even used clear at the very top.

 채택된 답변

Jason Ross
Jason Ross 2011년 5월 4일

0 개 추천

Are you exhausting some resource the first time through that prevents the second run from using them? Examples might include but are not limited to memory, disk space, network connections, file handles, serial connections or communications ports.
Without more specifics (profiler output, what you are doing, example code, OS, version) it's very difficult to say where the problem may lie.
Also, does it go away when you restart MATLAB? When you restart the machine?

댓글 수: 5

yes it actually does go away when i restart matlab. is there anyway i can get rid of this problem? i am working with really large numbers, would that be the problem?
I assume you mean very large arrays, not numbers?
It very well could be, especially if you're on a 32 bit system. I crash my system quite often working with large matrices.
You can examine your memory utilization using the techniques in
http://www.mathworks.com/support/tech-notes/1100/1106.html
Hopefully this will help.
ok thank you. i am trying that out right now.
Hi guys, I'm with the same issue, I'm working with a Kalman Filter code and i just can run the code once, I've tried the things above, but didnt worked!

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

추가 답변 (2개)

Jan
Jan 2011년 5월 4일

1 개 추천

Use the command "profile" to see, where the time is lost in the 2nd run.
Robert Cumming
Robert Cumming 2011년 5월 5일

0 개 추천

are you using a mex function or a dll? If so it could be that one of those has a memory leak? Meaning that clear all is nto actually clearing everything...

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

태그

아직 태그를 입력하지 않았습니다.

질문:

2011년 5월 4일

댓글:

2021년 1월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by