"How to resolve 'Failed to evaluate mask initialization commands' error in MATLAB Simulink when opening/running a model due to inability to open 'mppt1.fis' file?"

74 次查看(过去 30 天)
Warning:Error evaluating 'PostLoadFcn' callback of block_diagram 'FLC_For_S'.
Callback string is 'fuzzyLogicDesigner('mppt1')'
Caused by:
Unable to open file 'mppt1.fis'.
Here FLC_For_S.slx is the simulink model and mppt1.fis is the fuzzy inference system
My model is A Fuzzy Logic-Based MPPT Controller for Photovoltaic Systems

回答(2 个)

Avadhoot
Avadhoot 2024-3-20
From the error description it seems like MATLAB is not able to open the "mppt1.fis" file. This can be handled in two ways as follows:
1) First load the .fis file into the MATLAB base workspace using the "readfis" function. Then pass it to the "fuzzyLogicDesigner". You can refer the below code for this
fis = readfis("mppt1.fis");
fuzzyLogicDesigner(fis);
2) Directly mention the filepath as a parameter to the "fuzzyLogicDesigner" function. Make sure that the .fis file is on the MATLAB path
fuzzyLogicDesigner("mppt1.fis");
Mention the filename with its extension in the fuzzyLogicDesigner parameter so that the file can be read. Ensure that the file is on the MATLAB path and has appropriate permissions to access it.
For more information on the "readfis" function refer to the below documentation:
I hope it helps.

Kishen Mahadevan
Kishen Mahadevan about 16 hours 前
Starting with MATLAB R2025a, you can now open Fuzzy Logic Designer App directly from the Fuzzy Logic Controller block in Simulink. This will eliminate the need to open the app from within a callback function in Simulink.
You can click the Design button in the Fuzzy Logic Controller block dialog to launch the Fuzzy Logic Designer app, modify your FIS, and update the block automatically.
Here is a screenshot of the Fuzzy Logic Controller Block Dialog in R2025a:
Check out the following documentation pages to learn more:
If you are working with an earlier MATLAB version (<R2025a):
This error message —
“Warning:Error evaluating 'PostLoadFcn' callback of block_diagram 'FLC_For_S'.
Callback string is 'fuzzyLogicDesigner('mppt1')'
Caused by:
Unable to open file 'mppt1.fis'.”
usually indicates that the referenced FIS file cannot be found on the MATLAB path.
Make sure the file (mppt1.fis) is located either:
  • in your current MATLAB working folder alongside your Simulink model, or
  • in any folder that has been added to the MATLAB path.
Once the .fis file is accessible, the 'PostLoadFcn' callback in the model should run without an error.
Side note: When using the code within the callback function "fuzzyLogicDesigner('mppt1.fis')" , the .fis extension is optional.
Both of the following are equivalent:
fuzzyLogicDesigner("mppt1.fis")
and
fuzzyLogicDesigner("mppt1")
Thanks!

类别

Help CenterFile Exchange 中查找有关 Fuzzy Logic in Simulink 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by