How to plot a 3D grid in MATLAB which has been exported from Petrel with the MATLAB-Petrel plugin?
1 次查看(过去 30 天)
显示 更早的评论
Hello Community,
I have exported a grid from Petrel with the MATLAB-Petrel plugin. I can read this grid with no problem into MATLAB with the load command (A=load("TEST.mat"). I have a problem plotting this grid in MATLAB. Below what I have been trying and the error message I get. I have attached the grid to this posting. I hope you can help me here.
>> meshgrid(A.Node.X,A.Node.Y,A.Node.Z)
Error using repmat
Requested 38704x38704x38704 (431974.1GB) array exceeds maximum array size preference.
Creation of arrays greater than this limit may take a long time and cause MATLAB to become
unresponsive. See array size limit or preference panel for more information.
Error in meshgrid (line 77)
xx = repmat(xx, ny, 1, nz);
Do you have any suggestion what is going wrong?
I tried to change the maximum array size to 100000, but was not allowed to go over 10000.
Kind Regards,
Ferry
0 个评论
回答(1 个)
Pranjal Kaura
2021-9-1
Hey,
It looks like the creation of the 3-D meshgrid for your input vectors ('A.Node.X', 'A.Node.Y', 'A.Node.Z') requires very large amounts of memory allocation, which exceeds maximum array size preference. To know more about the variable size preferences, please refer https://www.mathworks.com/help/matlab/matlab_env/set-workspace-and-variable-preferences.html.
A workaround could be to to generate the required matrices in batches and concatenating them in an external .mat file. You can read more about it here. However, looking at the error, and the input vector dimensions, your machine would still need 400+ TB of memory and the computation would take a lot of time, making the approach non-viable in most scenarios.
You could try reducing the input vector size, or replacing meshgrid with another function.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Performance and Memory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!