Clear Filters
Clear Filters

arranging a matrix

1 view (last 30 days)
madhuri sachane
madhuri sachane on 15 May 2012
thanks
now the doubt is that,
when I display the [c] matrix it shows 2*7 matrix
And workspace shows 240*7 matrix.
the problem is that
>>a=rand(2 ,7);
what should be the elements.
for my code I got 2*7 matrix with element values different for each iteration that values I want to display in matrix [c].
actually i am working on iris recognition.
for feature extraction.I use wavelet decomposition at level 5 then applied 2 D gabor filter for 6 orientation & 4 scales. i.e 5*4*6=120 for horizontal & 120 for vertical details;for obtained detail coefficients i.e vertical & horizontal details, then moment invariant are computed which is a set of seven element row vector.
such two vectors for vertical & horizontal details are obtained.that are represented in a matrix & formed a matrix of 2*7.
>>for i = 1:level,
>>
>>for k=1:p
>> for n=1:N
% create template for horizontal component
polar_array=hdi;%hdi is horizontal detail.
[template,mask] = encode(polar_array, nscales, minWaveLength, mult, sigmaOnf);
F=template;
[phi] = invmoments(F);
phi=[phi(1) phi(2) phi(3) phi(4) phi(5) phi(6) phi(7)];
horzmi=ceil(phi);%hormi is horizontal moment invariants
disp('horzmi');
disp(horzmi);
% create template for vertical component
polar_array=vdi; %vdi is vertical detail coefficient.
[template,mask] = encode(polar_array, nscales, minWaveLength, mult, sigmaOnf);
F=template;
[phi] = invmoments(F);
phi=[phi(1) phi(2) phi(3) phi(4) phi(5) phi(6) phi(7)];
vertmi=ceil(phi);%vertmi is vertical moment invariants.
disp('vertmi');
disp(vertmi);
C=[vertmi;horzmi];
disp ('feature vector');
disp(C);
end
end
end
Now from this code I want to generate a matrix of 240*7.where matrix C is 2*7 matrix.
will you suggest me for matrix creation.

Answers (1)

Walter Roberson
Walter Roberson on 15 May 2012
Before the code:
allC = zeros(240,7);
R = 1;
In the code after you disp(C),
allC(R:R+1,:) = C;
R = R + 2;
At the end, allC will be your 240 * 7 matrix.

Community Treasure Hunt

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

Start Hunting!