필터 지우기
필터 지우기

How to convert scilab code into matlab?

조회 수: 50 (최근 30일)
sudha
sudha 2014년 3월 21일
댓글: Walter Roberson 2024년 5월 7일
I have a code in Scilab. How to convert that code into Matlab?? Can anyone please tel me..
  댓글 수: 2
PADMA PRIYA
PADMA PRIYA 2024년 5월 7일
clear ;
clc ;
k = 4; //message bits
n = 7; // block length
m = n-k; //Number o f p a r i t y b i t s
I = eye(k,k); // i d e n t i t y mat r ix
disp (I, ' identity matrix Ik ' )
P =[1,1,0;0,1,1;1,1,1;1,0,1]; // c o e f f i c i e n t mat r ix
disp (P, 'coefficient matrix P' )
G = [P I]; // generator matrix
disp (G, ' generator matrix G' )
H = [eye(k -1,k -1) P' ]; // parity check matrix
disp (H, ' parity check matrix H' )
//message bits
m =[0,0,0,0;0,0,0,1;0,0,1,0;0,0,1,1;0,1,0,0;0,1,0,1;0,1,1,0;0,1,1,1;];
C = m*G;
C = modulo (C ,2) ;
disp (C, 'Code words o f ( 7 , 4 ) Hamming code ' )
Walter Roberson
Walter Roberson 2024년 5월 7일
clear ;
clc ;
k = 4; %//message bits
n = 7; %// block length
m = n-k; %//Number o f p a r i t y b i t s
I = eye(k,k); %// i d e n t i t y mat r ix
disp (' identity matrix Ik ' )
identity matrix Ik
disp(I)
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
P =[1,1,0;0,1,1;1,1,1;1,0,1]; %// c o e f f i c i e n t mat r ix
disp ('coefficient matrix P' )
coefficient matrix P
disp ( P )
1 1 0 0 1 1 1 1 1 1 0 1
G = [P I]; %// generator matrix
disp (' generator matrix G' )
generator matrix G
disp ( G )
1 1 0 1 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0 1 0 1 0 0 0 1
H = [eye(k -1,k -1) P' ]; %// parity check matrix
disp (' parity check matrix H' )
parity check matrix H
disp ( H )
1 0 0 1 0 1 1 0 1 0 1 1 1 0 0 0 1 0 1 1 1
%//message bits
m =[0,0,0,0;0,0,0,1;0,0,1,0;0,0,1,1;0,1,0,0;0,1,0,1;0,1,1,0;0,1,1,1;];
C = m*G;
C = mod (C ,2) ;
disp ( 'Code words o f ( 7 , 4 ) Hamming code ' )
Code words o f ( 7 , 4 ) Hamming code
disp ( C )
0 0 0 0 0 0 0 1 0 1 0 0 0 1 1 1 1 0 0 1 0 0 1 0 0 0 1 1 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 0 0 1 1 0 0 0 1 0 1 1 1

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2014년 3월 21일
Paste it into MATLAB and start changing it into MATLAB syntax.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by