How can I use repmat function for the following code?
Show older comments
I need to remove the for loop and I want use repmat for this code
Y= zeros(64,64);
load('brain512.mat')
X=data;
Z = imresize(X, [64 64]);
N=64;
m=64;
n=64;
for p=0:N-1
for q=0:N-1
for j=0:m-1
for k=0:n-1
Y(p+1,q+1) = Y(p+1,q+1)+exp(-2*pi*1i*p*j/m)*exp(-2*pi*1i*q*k/n)*Z(j+1,k+1);
end
end
end
end
4 Comments
Image Analyst
on 7 Sep 2018
For some reason you removed all the comments in your code before you posted it (which I'm sure you had, like all good programmers do). So, explain in words what it does.
Akshay Khadse
on 10 Sep 2018
Edited: Akshay Khadse
on 10 Sep 2018
Please do mention the contents of 'brain512.mat'.
Bhanu Prakash Edukulla
on 22 Sep 2018
Answers (0)
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!