not able to link my mat files to lookup tables

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

Martin

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,Manu

test_standalone.plecs (9.2 KB)

test_blockset.mdl (35.2 KB)

test.mat (323 Bytes)