Export Model as FMU with Linux Binary on Windows
13 次查看(过去 30 天)
显示 更早的评论
Hello Mathwork team:
I would like to export FMU according this documnent(Export Model as FMU with Linux Binary on Windows - MATLAB & Simulink - MathWorks China) .
but after I try generate FMU model, a error happened. it tell me “Failed to setup the environment. WSL must be at least version '2.0.9.0'. ”. Then I have check my WSL verison. it shows my WSL version is 2.2.4.0. and I have run WSL --update and try to update the version of WSL, but it tell me my WSL version is the latest one.
so I think my WSL is the latest one, but why simulink still reminde me that my WSL version is not ok? can you help me to solve it.
matlab verstion: 2024a update 4
FMU builder version: 24.1.1
thank you
2 个评论
Umar
2024-6-30
Hi Wen li,
To address the issue with the WSL version error in MATLAB when exporting an FMU model, ensure that the WSL version is correctly recognized by MATLAB. Sometimes, even though the WSL version is up to date, MATLAB may not detect it accurately.
One workaround is to manually set the WSL version in MATLAB by modifying the system environment variables. You can try setting the WSL version to '2.0.9.0' explicitly in the system settings to see if MATLAB recognizes it correctly.
Hope that answers your question.
采纳的回答
Umar
2024-7-1
Hi Wen li,
This one is a little tough to tackle, sounds like IT Engineer job. However, if I jog my memory, you have to manually set the WSL version in MATLAB by following these steps: first, try Open the System Properties window by pressing Windows key + Pause/Break. Then, click on "Advanced system settings" on the left.Afterwards, in the System Properties window, go to the "Advanced" tab and click on "Environment Variables". Under System Variables, click on "New" and add a new variable: Variable name: WSLENV Variable value: MATLAB_VER=2.0.9.0
Then, click "OK" to save the changes and restart MATLAB to apply the new WSL version setting.
By explicitly setting the WSL version to '2.0.9.0' in the system settings, you can help MATLAB recognize the correct WSL version and resolve the export issue with FMU models.
Let me know if you need my further assistance. Good luck!
更多回答(1 个)
Umar
2024-7-3
Hi Wen,
Analyzing your error message, the assertion failure typically occurs when a condition that should be true at a particular point in the code is false. In this case, the assertion failure might be due to a discrepancy or inconsistency in the code or the settings related to FMU generation.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!