metalnumb
Newbie level 4
Hey Guys !
I've been woking on this project and i dont know why it does not work....:evil:
its required to make a simple ciphering function for images with any dimension..( just to make its details unclear for example)
it just gives this error everytime i call the function... :shock:
what am i doing wrong ? please help me out !
thanks in advance !!;-)
I've been woking on this project and i dont know why it does not work....:evil:
its required to make a simple ciphering function for images with any dimension..( just to make its details unclear for example)
Code:
function [op]=cphx(ip)
n= ip([end:-1:1],[end:-1:1],:) ; % flipped 180 degrees and mirrored.
% Puzzling The Image
%====================
a=n([1:end/2],[1:end/2],:) ; % i.e (1/4) of the image(dividing the image into 4 chunks)=(A)
b=n([end/2:end],[1:end/2],:) ; % =(B)
c=n([1:end/2],[end/2:end],:) ; % =(C)
d=n([end/2:end],[end/2:end],:) ; % =(D)
op=[a d;c b]; % Shuffling the pieces will render the image almost ciphered.
it just gives this error everytime i call the function... :shock:
Code:
??? Subscript indices must either be real positive integers or logicals.
Error in ==> cphx at 8
b=n([end/2:end],[1:end/2],:) ; % =(B)
what am i doing wrong ? please help me out !
thanks in advance !!;-)