maximum MATLAB array size in C

I'm running a C program using MATLAB libraries for getting data from A.mat file. Then I do some computations and write data into another B.mat file.
I have no trouble getting this data from A.mat into C (array 1x293999160 elements) but when I try to write this array back into B.mat, MATLAB complaints:
terminate called after throwing an instance of 'foundation::core::except::Exception<MATLAB::legacy_two_part::p64bitsize, std::exception, void>' what(): Maximum variable size allowed by the function is exceeded. Aborted (core dumped)
I'm running MATLAB 2018a on Ubuntu 16.04. My laptop has 32GB of RAM.
If there any limit on C to MATLAB data transfer, can I change this limit manually?
Thank you in advance.

1 Comment

The message says Maximum variable size allowed by the function, there's something in your code--possibly you've incorrectly tried to allocate B.
Not possible to debug without code (and maybe calling sequence).

Sign in to comment.

Answers (0)

Asked:

on 23 Aug 2018

Commented:

dpb
on 23 Aug 2018

Community Treasure Hunt

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

Start Hunting!