MATLAB Answers

MatLab crashes when I insert a large dataset that I am assigning to a matrix

10 views (last 30 days)
Madison Lester
Madison Lester on 16 Jun 2021
Answered: Walter Roberson on 16 Jun 2021
I have a dataset that has more than 4000 rows. When I go to insert it from excel, MatLab crashes and closes completely. There is no error message before it crashes. Is there a setting I can change, so it will accept more data at one time?
  4 Comments
Madison Lester
Madison Lester on 16 Jun 2021
I was trying to paste it from my clipboard. That is what I was told to do, and it works for smaller matrices. I do not use MatLab often enough to have tried any other ways. Thank you for your help.

Sign in to comment.

Answers (2)

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 16 Jun 2021
Probably it is related to allocated swap memory for matlab. You can play with tall() to fix this issue.
Here is a nice help doc of MATLAB on this:
https://www.mathworks.com/help//matlab/matlab_prog/resolving-out-of-memory-errors.html

Walter Roberson
Walter Roberson on 16 Jun 2021
In the main MATLAB command window, Preferences -> MATLAB -> General -> Java Heap Memory
and increase the memory allocation. You will need to restart MATLAB for the change to have effect.
Java memory is used in processing the clipboard.
... but using readmatrix() is a much better approach.

Community Treasure Hunt

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

Start Hunting!

Translated by