How to find indices of array in hdl coder?

7 views (last 30 days)
Siddarth S
Siddarth S on 25 Feb 2024
Edited: Siddarth S on 5 Mar 2024
I am trying to work on a hdl code using matlab with hdl coder.The matlab code generates it into fixed point code sucessfully but when i try to convert the fixed point code to hdl format,I am facing some issues constantly.The code has part about finding the various indices of an array using if condition in which the error arises.
The error I am getting is:
ErrorFound an unsupported unbounded loop structure, at Function 'ifWhileCond' (#96.698.975), line 31, column 1 Function 'ifWhileCond' (#96.455.469), line 18, column 13 Function 'segmentationHDLdesign_fixpt' (#1.1070.1146), line 32, column 5. This loop may be user written or automatically generated due to the use of specific vector expressions or functions.
Code:
% %columnwise histogram segmentation
for i=1:n
if(image(:,i)==b)
y(i)=i;
end
end
col=zeros(1,322);
k=1;
for i=1:322
if(y(i)==0)
col(k)=i;
k=k+1;
end
end
  6 Comments
Siddarth S
Siddarth S on 5 Mar 2024
Edited: Siddarth S on 5 Mar 2024
This also didn't work when I tried to transform it to hdl form.Same issue arised.Although when I ran both the loops in seperate codes,I was able to get the right results and the code was able to transform in HDL format with HDL coder with no issues.So can I use those functions in my main design function? Will this be considered as sub blocks?
Siddarth S
Siddarth S on 5 Mar 2024
I would also like the give context that the code I am trying is for image segmentation code where I am trying to get the text from image.I am trying for histogram segmentation where I detect the rows and columns for the presence of text and cut the image accordingly.

Sign in to comment.

Answers (0)

Categories

Find more on Code Generation in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!