Using direct lookup table as input to a matlab function block in simulink => error in "Check Block Compatibility" of "HDL Workflow Advisor"
1 view (last 30 days)
Show older comments
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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/202240/kjgkjkhzi.png)
![kjgkjkhzi.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/202240/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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/202241/erueitei.png)
Thank you for your help, very much appreciated.
0 Comments
Answers (1)
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
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!