Effacer les filtres
Effacer les filtres

2-D lookup table error

25 vues (au cours des 30 derniers jours)
Kaiser Ahmed Bhuiyan
Kaiser Ahmed Bhuiyan le 18 Fév 2023
I am trying to feed a matlab lookup table object (file name= Cp) to a 2-D lookup table block. The file format is ok, but when i select it , a message pops up every time- "
  • Variable Cp referenced by block 'Assignment1/Subsystem/2-D Lookup Table' does not resolve to a valid Simulink.LookupTable object.
The table i am trying to load shows as a "Struct" in matlab workspace. What i can i do to solve this issue ? I am really stuck here.
  1 commentaire
Walter Roberson
Walter Roberson le 19 Fév 2023
What is a "matlab lookup table object" ? Simulink defines lookup table objects, but I do not recall seeing any such object in MATLAB itself ? I especially do not remember any such object being represented as a struct.

Connectez-vous pour commenter.

Réponses (1)

Shubham
Shubham le 10 Mar 2023
Hi Kaiser,
The error message suggests that the variable "Cp" that you are referencing in your 2-D Lookup Table block is not a valid Simulink.LookupTable object. This could happen if the variable "Cp" is not loaded properly in your Simulink model or if it is not a compatible data type for the 2-D Lookup Table block.
To resolve this issue, here are some steps you can try:
  1. Ensure that the variable "Cp" is loaded properly in your Simulink model. You can do this by checking the workspace browser in Simulink and confirming that the variable "Cp" is present and has the correct data type.
  2. Check the format of the file that you are using to load the lookup table. The file should be in a compatible format for the 2-D Lookup Table block. You can refer to the documentation for the 2-D Lookup Table block to see the supported file formats.
  3. If the file format is correct, try converting the "Cp" variable to a Simulink.LookupTable object using the "lut" function in MATLAB. Here is an example code snippet:
Cp_lut = lut(Cp.x, Cp.y, Cp.z);
This will convert the "Cp" variable to a Simulink.LookupTable object called “Cp_lut". You can then use this object in your 2-D Lookup Table block.
If none of the above steps work, you can try creating a new Simulink.LookupTable object in Simulink and manually entering the data from your "Cp” table. To do this, you can right-click on the 2-D Lookup Table block and select "Edit Data". Then, enter the data points from your "Cp" table in the appropriate fields.

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by