Field II kidney example does not work due to "Requested array exceeds the maximum possible variable size." error
3 次查看(过去 30 天)
显示 更早的评论
I am trying to run on my computer example provided by FIELD II site: Field II Ultrasound Simulation Program (field-ii.dk). I create all the simulated rf-data as in example. When it comes to produce B-mode image function fast_int is called. It's .C program for fast interpolation. On the website was given fast_int.mexw32 file only so I converted .c file using mex function into .mexw64. And it does not work even though all my variables are set exacly as in the example.
I provide below given message and fast_int code in txt format. If anyone could direct me why this example is not executable in my case i would highly appriciate. I wonder if this example was run on different system or matlab version and somehow there was no variable size problem? I am not familiar with c programming so i am not sure where exacly in the main function problem occurs.
采纳的回答
James Tursa
2023-9-20
At first glance this is the obvious problem in the original source code: The dimensions array needs to be the proper integer size for API calls, so you need to change this:
int dimension[2];
to this
mwSize dimension[2];
Also, you may get a compiler warning on this conversion:
(unsigned char *) mxGetPr(etc)
so I would change it to this instead:
(unsigned char *) mxGetData(etc)
0 个评论
更多回答(1 个)
Himanshu
2023-9-20
Hey,
I understand that you are encountering the error "Requested array exceeds the maximum possible variable size" when trying to run a MEX function.
This error typically occurs when your code asks MATLAB to create an array which is larger than MATLAB can theoretically create. The requested array would have more elements than the maximum number of elements an array can possibly have in MATLAB.
Here are some ways of handling the error:
- Try to reduce the size of the problem.
- Change the type of the variable being used to ensure that the array takes less space.
- Divide the problem into smaller subproblems.
For a detailed description of the error and ways of handling the problem, you can refer to the following MALTAB Answer:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!