Error using Matlab HDL Coder

OP #4381833
Rate this post
• ▲ useful
▼ not useful
Hi, Can some one please help out.Thanks. I am trying to convert below 
code to VHDL using HDL Coder but getting error. The HDL Coder Block file 
is also attached .Please can you have a look on it and see whats the 
mistake in block diagram.
1
x1=[1 2 3 4 5 6 7 8 9];
2
x2=[3 4 5 6 7 8 9 2 1];
3
n=length(x1);
4
xc=zeros(2*n-1,1);
5
for i=1:2*n-1
6
  if(i>n)
7
      j1=1;
8
      k1=2*n-i;
9
      j2=i-n+1;
10
      k2=n;
11
  else
12
      j1=n-i+1;
13
      k1=n;
14
      j2=1;
15
      k2=i;
16
  end
17
  xc(i)=sum(conj(x1(j1:k1)).*x2(j2:k2));
18
end
19
xc=flipud(xc);


Error:

Cannot connect to model 'prc4'; please try Update Diagram (Ctrl-D).

Error due to multiple causes.

Errors occurred during parsing of MATLAB function 'MATLAB Function'(#24)

Error in port widths or dimensions. Output port 1 of 'prc4/MATLAB 
Function/u' is a one dimensional vector with 1 elements.
Attached files:

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.