Need help in Mathlab SImulink
Hi All,
I have designed a code generator in matlab, I need to build a simulink model of that code generator. Can anyone help me in this. I can send the mathlab code if needed.
Thank you
I have designed a code generator in matlab, I need to build a simulink model of that code generator. Can anyone help me in this. I can send the mathlab code if needed.
Thank you
Replies
-
Kaustubh KatdarePost your matlab code and enclose it with
[ /code] tags.
-
habibctgstage=4;
n = stage-2;
N_z = 2^n-1;
C0 = [1 1];
S0 = [1 -1];
C1 = conj(fliplr(S0));
S1 = -conj(fliplr(C0));
Mat_C = [C0 S0; C1 S1];
for iter=1:n-1
iter
Length = 2^(iter+1);
M_tmp=[];
for loop=1:4:Length-3
loop
M_tmp(loop ,๐ = [Mat_C((loop-1)/2+1,1:Length/2) Mat_C((loop-1)/2+2,1:Length/2) Mat_C((loop-1)/2+1,Length/2+1:Length) Mat_C((loop-1)/2+2,Length/2+1:Length)];
M_tmp(loop+1,๐ = [Mat_C((loop-1)/2+1,1:Length/2) -Mat_C((loop-1)/2+2,1:Length/2) Mat_C((loop-1)/2+1,Length/2+1:Length) -Mat_C((loop-1)/2+2,Length/2+1:Length)];
M_tmp(loop+2,๐ = [Mat_C((loop-1)/2+2,1:Length/2) Mat_C((loop-1)/2+1,1:Length/2) Mat_C((loop-1)/2+2,Length/2+1:Length) Mat_C((loop-1)/2+1,Length/2+1:Length)];
M_tmp(loop+3,๐ = [Mat_C((loop-1)/2+2,1:Length/2) -Mat_C((loop-1)/2+1,1:Length/2) Mat_C((loop-1)/2+2,Length/2+1:Length) -Mat_C((loop-1)/2+1,Length/2+1:Length)];
end
Mat_C = M_tmp
end
G = Mat_C;
N_zero = zeros(1,N_z) ;
L2 = length(G(1,๐);
codeset(1,๐ = [N_zero(1:N_z) G(1,1:L2/2) N_zero(1:N_z) G(1,L2/2+1:L2)];
codeset(2,๐ = [N_zero(1:N_z) G(2,1:L2/2) N_zero(1:N_z) G(2,L2/2+1:L2)];
this is the matlab code. tq -
habibctg
stage=4; n = stage-2; N_z = 2^n-1; C0 = [1 1]; S0 = [1 -1]; C1 = conj(fliplr(S0)); S1 = -conj(fliplr(C0)); Mat_C = [C0 S0; C1 S1]; for iter=1:n-1 iter Length = 2^(iter+1); M_tmp=[]; for loop=1:4:Length-3 loop M_tmp(loop ,:) = [Mat_C((loop-1)/2+1,1:Length/2) Mat_C((loop-1)/2+2,1:Length/2) Mat_C((loop-1)/2+1,Length/2+1:Length) Mat_C((loop-1)/2+2,Length/2+1:Length)]; M_tmp(loop+1,:) = [Mat_C((loop-1)/2+1,1:Length/2) -Mat_C((loop-1)/2+2,1:Length/2) Mat_C((loop-1)/2+1,Length/2+1:Length) -Mat_C((loop-1)/2+2,Length/2+1:Length)]; M_tmp(loop+2,:) = [Mat_C((loop-1)/2+2,1:Length/2) Mat_C((loop-1)/2+1,1:Length/2) Mat_C((loop-1)/2+2,Length/2+1:Length) Mat_C((loop-1)/2+1,Length/2+1:Length)]; M_tmp(loop+3,:) = [Mat_C((loop-1)/2+2,1:Length/2) -Mat_C((loop-1)/2+1,1:Length/2) Mat_C((loop-1)/2+2,Length/2+1:Length) -Mat_C((loop-1)/2+1,Length/2+1:Length)]; end Mat_C = M_tmp end G = Mat_C; N_zero = zeros(1,N_z) ; L2 = length(G(1,:)); codeset(1,:) = [N_zero(1:N_z) G(1,1:L2/2) N_zero(1:N_z) G(1,L2/2+1:L2)]; codeset(2,:) = [N_zero(1:N_z) G(2,1:L2/2) N_zero(1:N_z) G(2,L2/2+1:L2)];
You are reading an archived discussion.
Related Posts
hi everybody!!
what is the functioning of mosfet drivers? when are mosfet drivers used?๐
we have selected a project which will start computer at specific time and start downloading specific file from internet .After downloading file ,file will
be saved and computer will shut...
Hi friends..!
My name is Sudheer doing final year mechanical BE in Koneru Lakshmaiah College of Engineering.
I am from vijayawada. Andhra Pradesh.
I joined this site through google search...
Hi CE
Here i want to disscuss the new topic that Can we trace or get moment of any computer ? By any method?
This is not a JUNK or...
Hai buddies, here are some interesting topics where we can give either seminar or do mini project...
1.) Advances in automobiles--> 4 wheel steering, VVTi, twin disc brake system, distribution...