0
votes

I wrote this code inside the M Blcok (one of Xilinx blockstes in Simulink):

function z= discorr(x,y)

t=zeros(12288,1);
i=zeros(12288,1);
k=zeros(12288,1);
i(4096:8191,1)=x(1:4096,2); %output of the image filter
t(4096:8191,1)=y(1:4096,2);   %output of the tamplate filter
i=i';
z=A(1:4096,1);
    for n=1:8191
k=zeros(12288,1);
k(n:n+4095,1)=t(4096:8191,1);
z(n,2)=i*k;

     end
end

Its telling me:

Error("discreatcorr.m"): Syntax error: Lexical error at line 15, column 0. Encountered:  after : "\';\r\nz=A(1:4096,1);\r\nfor n=1:8191\r\n k=zeros(12288,1);\r\n k(n:n+4095,1)=t(4096:8191,1);\r\n z(n,2)=i*k;\r\n end\r\nend\r\n"

Error("discreatcorr.m"): Syntax error: Lexical error at line 15, column 0. Encountered:  after : "\';\r\nz=A(1:4096,1);\r\nfor n=1:8191\r\n k=zeros(12288,1);\r\n k(n:n+4095,1)=t(4096:8191,1);\r\n z(n,2)=i*k;\r\n end\r\nend\r\n"
Error occurred during "Block Configuration".

althogh there is nothing in line 15 in the code

it is giving an error at the end of the code

Any Ideas??

1
I have a feeling that even if it works, that'll synthesise to a staggeringly large amount of logic... - Martin Thompson

1 Answers

0
votes

The problem is that your system misinterprets the ' symbol as string symbol. Replacing the line i=i'; by i=transp(i); should solve the problem.