Clear Filters
Clear Filters

Using direct lookup table as input to a matlab function block in simulink => error in "Check Block Compatibility" of "HDL Workflow Advisor"

2 views (last 30 days)
Hello everyone,
In my Simulink model I have a matlab function block, with the following code:
function device_exist = look_4_device_addr(device_list, device_addr)
%#codegen
device_exist=logical(0);
for indice = 1:length(device_list)
if device_addr==device_list(indice)
device_exist=logical(1);
break;
end;
end;
and in my simulink model I have the following blocks:kjgkjkhzi.PNG
as you can see I'm giving the matlab function block a "direct lookup table" as input "device_list", so the function can search for the device_addr inside this direct lookup table.
This works fine in simulation, but in the hdl workflow advisor i get the following error in the "check Block Compatibility" step:
Internal Error: Evaluation of validate function on class hd defaults.DirectLookupTable failed with the error message: MATLAB:cellRefFromNonCell: Brace indexing is not supported for variables of this type.
Can you please help me figure out the problem. Am I not supposed using direct lookup tables as arrays to a matlab function simulink block? also it's a bit strange because I'm not using any braces anywhere and why is this supposed problem not reported in simulation?
This is a capture of table data parameter:
erueitei.PNG
Thank you for your help, very much appreciated.

Answers (1)

Kiran Kintali
Kiran Kintali on 1 Feb 2019
Can you please send the reproduction steps to kiran.kintali@mathworks.com? We can help further analyze the issue.
thanks

Categories

Find more on Code Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!