3% Description: This function converts
a gray coded
string to its equivalent
4% decimal representation.
6% Call Syntax: [output_variables] = function_name(input_variables)
11% Description: each row represents a gray coded
string
17% Description: decimal numbers in column vector form of size, size(gra,1) x 1
19% Creation Date: 08/07/2005
20% Author : Arjun Srinivasan Rangamani
22%*************************************************************************
28 error('Error (
gc2dec): must have only 1 input argument.');
32s1 = size(gra,1);%num of rows in input vector
33s2 = size(gra,2);%num of columns in the input vector
34dec = zeros(s1,1);%size of the o/p decimal number sequence
35bin =
char(zeros(1,s2));
38%gray to binary conversion
41 temp = mod(sum(gra(j1,1:j2-1)),2);
43 bin(j2) = num2str(1 - gra(j1,j2));
45 bin(j2) = num2str(gra(j1,j2));
48 bin(1) = num2str(gra(j1,1));
49 dec(j1,1) = bin2dec(bin);