필터 지우기
필터 지우기

array slicing in place

조회 수: 8 (최근 30일)
Nitai Fingerhut
Nitai Fingerhut 2020년 4월 1일
답변: Ameer Hamza 2020년 4월 1일
Hi
I'm trying to slice a really big array, but I'm getting out of memory.
is it possible to do slicing "in-place" (similar to python), where it will use the same memory?
e.g:
size(mat) ==> 32 X 32 X 750 X 2 X 1000
mat = mat(1:31,1:31,:,:,:) ;
the last operation allocates a new array, and only after it finishes copying it releases the old one (and keep naming the same).
It does not slice it in place, hence requires (almost) twice the memory.
any ideas?
Thanks

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 4월 1일
As an alternative, you might also look into matfile() if the file is already saved in a mat file.

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by