Info

この質問は閉じられています。 編集または回答するには再度開いてください。

can anyone explain what does this code do? Thanks in advance

1 回表示 (過去 30 日間)
SIBI SIVA
SIBI SIVA 2017 年 4 月 10 日
閉鎖済み: Stephen23 2017 年 4 月 10 日
clc;
clear all;
close all;
imag1 = imread('peppers.png');
imag2=rgb2gray(imag1);
x= imresize(imag2, [64, 64]);
[n,m,k]=size(x);
b=8;
n=n*b*m;
bi = zeros(n,1,'uint8');
c = 0.3;
tic;
for i = 2 : n
sum = 1 - 2* c * c;
if (sum<0.0)
bi(i-1) = 1;
end
c = sum;
end
key = zeros(n/b,1,'uint8');
for i1 = 1 : n/b
for i2 = 1 : b
key(i1) = key(i1) + bi(i2*i1)* 2^(i2-1);
end
end;
[n, m, k] = size(x)
for ind = 1 : m
Fkey(:,ind) = key((1+(ind-1)*n) : (((ind-1)*n)+n));
end
for i3 = 1 : k
x1= x(:,:,i3);
for i4 = 1 : n
for i5=1:m
y(i4,i5) = bitxor(x1(i4,i5),Fkey(i4,i5));
end
end
xout(:,:,i3) = y(:,:,1);
end;
  1 件のコメント
per isakson
per isakson 2017 年 4 月 10 日
  • Click the Help button above the edit-box, in which you write your question.

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 4 月 10 日
What does the program documentation say about what it does and how it works? What did the author of the code say when you asked them what the program was for? What were you searching for when you found the code, or did you just ask Google to find yourself a random MATLAB program that you thought you might start learning MATLAB from?

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by