For lpp in Matlab HDL Coder ?

Discussion in 'Embedded Systems and Microcontrollers' started by jamil1988, Dec 7, 2015.

  1. jamil1988

    Thread Starter New Member

    Nov 19, 2015
    11
    0
    Dear All,
    I am sorry if I say any thing silly.Please forgive me.

    I am trying to implement below code in Matlab HDL Coder but facing problems getting error below.
    Code (Text):
    1.  
    2. x1=[1 2 3 4 5 6 7 8 9];
    3.  
    4. x2=[3 4 5 6 7 8 9 2 1];
    5.  
    6. n=length(x1);
    7. xc=zeros(2*n-1,1);
    8. for i=1:2*n-1
    9. if(i>n)
    10. j1=1;
    11. k1=2*n-i;
    12. j2=i-n+1;
    13. k2=n;
    14. else
    15. j1=n-i+1;
    16. k1=n;
    17. j2=1;
    18. k2=i;
    19. end
    20. xc(i)=sum(conj(x1(j1:k1)).*x2(j2:k2));
    21. end
    22. xc=flipud(xc);
    23.  
    Can some please help me how is that possible.

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

    Error due to multiple causes.

    Data 'y' (#130) is inferred as a variable size matrix, while its specified type is something else.

    Even I am unable to understand the error.Please some one have a look into it.Thanks in advance.

    Mod note: added code tags
     
    Last edited by a moderator: Dec 7, 2015
Loading...