dst2(U)

Calculate the 2D discrete sign transform of function y.
118 Downloads
Updated 28 Feb 2015

View License

function out = dst2(U)
% DST calculate the 2D discrete sign transform of function y.
N = length(U);
A = zeros(N-1,N-1);
for m=1:N-1
for n=1:N-1
holder = 0;
for i=1:N-1
for j=1:N-1
holder = holder + ...
1 / (N - 1)^2 * ...
( U(i,j) * sin(pi * m * (i-1) / (N-1)) * ...
sin(pi * n * (j-1) / (N-1)) + ...
U(i,j+1) * sin(pi * m * (i-1) / (N-1)) * ...
sin(pi * n * j / (N-1)) + ...
U(i+1,j) * sin(pi * m * i / (N-1)) * ...
sin(pi * n * (j-1) / (N-1)) + ...
U(i+1,j+1) * sin(pi * m * i / (N-1)) * ...
sin(pi * n * j / (N-1)) );
end
end
A(m,n) = holder;
end
end
out = A;

Cite As

Koorosh Gobal (2024). dst2(U) (https://www.mathworks.com/matlabcentral/fileexchange/49864-dst2-u), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0