How to increase maximum number of open files for code generation

조회 수: 7 (최근 30일)
Milos Sotak
Milos Sotak 2022년 11월 21일
댓글: Milos Sotak 2023년 9월 8일
Dear
How to increase maximum number of open files for code generation.
It looks like there is fix number for maximum number of open files = 20.
If you open more then 20 files, you will recieve error "For code generation, maximum number of open files is 20."
it looks that this limit is setup in autogenerated file fileManager.c
Could you let me know how I can setup coder to allow e.g. 25 files?
Thanks
Milos

답변 (1개)

Prateek
Prateek 2022년 11월 24일
편집: Prateek 2022년 11월 24일
Hello Milos,
MATLAB places a limit of up to 20 open files in order to conserve static memory allocation.
It would be ideal to limit the number of files open simultaneously to 20. There is no limit to the number of files you can write, only to the number of files you can open at the same time.
This limit can be changed, but at your own risk. To do so, follow these instructions:
  1. Change MATLAB directory to /matlab/%release%/toolbox/eml/lib/matlab/iofun/private/
  2. Open “fileManager.m
  3. Locate the function “MAXFILES” (In MATLAB R2022a, go to line 325). This function contains the following code:
n = coder.const(FIDCLS(20));
4. Edit this to the number you need. It can be up to 125.
5. Save this file and restart MATLAB.
Please note that this change needs to be re-implemented after every MATLAB update.
Hope this helps.
Regards,
Prateek
  댓글 수: 2
Milos Sotak
Milos Sotak 2022년 11월 24일
Thank you very much for your ANSWER.
Milos
Milos Sotak
Milos Sotak 2023년 9월 8일
Hi Prateek,
How it works in 2023a?
There is no file “fileManager.m” in directory /matlab/%release%/toolbox/eml/lib/matlab/iofun/private/
Regards,
Milos

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by