i m doing a project on digital watermarking in which i hav to divide a matrix in 2X4 submatrices. I m using the command mat2cell for this purpose but there is a problem in the execution of the command.
Info
This question is closed. Reopen it to edit or answer.
Show older comments
clc
clear all
X =imread('F:\M.TECH PROJECT\shri ram.jpg');
for i=1:111
j=1:97;
v(i,j) = 2;
end
v = v(i,j);
vsize=size(v)
for j=1:97
i=1:111;
w(i,j) = 7;
end
w=w(i,j)';
wsize=size(w)
[rows,cols] = size(X)
a=sum(v)
b=sum(w)
C = mat2cell(X,v,w);
% for i=1:rows
% for j=1:cols
% C{i,j}
% end
% end
As per the rules of the command the dimensions of the matrix should be equal to the total no. of rows and columns of the submatrices, i have done it accordingly.
Still the command is not working.
2 Comments
Walter Roberson
on 13 Apr 2013
Is it producing an error, or is just not dividing the matrix the way you want?
Walter Roberson
on 13 Apr 2013
You should display size(X) -- it might not be the same as what you expect from your line [rows,cols] = size(X)
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!