Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

not able to link my mat files to lookup tables

0 votes

Hi everyone 

I cannot link some mat files i have generated in MATLAB to the lookup tables in PLECS

I copy the mat file to the same folder as where my PLECS model is located and write the name of the mat file in the 3D array of output values line but i get the following error when trying to run the model:

"Error in component 'VSC2L_PQ/PV': Initialization commands cannot be evaluated: error: load: unable to find file PVLookupData_BP365.mat"

I was of the impression that this was would work but no.


Best Regards


asked Feb 3, 2019 by martinkjr (12 points)

1 Answer

+1 vote

Hello Martin,

It is possible to link the .mat files to the PLECS Look-Up tables (from the Control domain). Please see the attached example. I have attached both PLECS Standalone and PLECS Blockset models. 

For example, if test.mat is the name of your .mat file, 

In PLECS Standalone, we load the .mat file by entering load('test.mat') in the Model initialization commands window, which can be accessed from the PLECS menu bar of your model: Simulation > Simulation parameters > Initialization. 

In PLECS Blockset, we load the .mat file by entering test in the InitFcn window, which can be accessed from the Simulink menu bar of your model: File > Model Properties > Callbacks. 

Then, on the PLECS schematic, you can simply enter the variables defined in the .mat file as the inputs of your look-up table.

Best regards,

answered Feb 4, 2019 by Manu Parimi (297 points)
edited Feb 4, 2019 by Manu Parimi