필터 지우기
필터 지우기

Out of memory error with Matlab function egm96geoid

조회 수: 2 (최근 30일)
Gerardo Arboleda
Gerardo Arboleda 2022년 3월 26일
댓글: Walter Roberson 2022년 3월 26일
The function egm96geoid crashes my simulation after nearly 3000 repetitions.
The error given is:
Out of memory.
Error in egm96geoid.m (<a href="matlab: opentoline('C:\Program Files\MATLAB\R2021b\toolbox\map\mapgeodesy\egm96geoid.m', 89)">
N = G(lat, lon);
Any ideas or suggestions?
  댓글 수: 3
Gerardo Arboleda
Gerardo Arboleda 2022년 3월 26일
I dont have access to my code right now unfortunately. However the code is very simple.
I call the function each time step of my simulation, within an iteration there are 100 steps, roughly.
The function probably got called more than 3000 times.
I think the problem has to do with the variable G in line 89 of the function, as it is defined as a persistent variable.
Walter Roberson
Walter Roberson 2022년 3월 26일
Your lat and lon are probably both arrays at that point. When you index an array with multiple indices, then the size of the result is the product of the sizes of the indices. For example if you were passing in lat and lon each as 1 x 4000 vectors, then G(lat,lon) would give you a 4000 x 4000 result.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by