필터 지우기
필터 지우기

Need Help implementing an equation

조회 수: 1 (최근 30일)
Rohan Repale
Rohan Repale 2013년 3월 28일
HI, I intend to implement this equation .....
f(x)=[(1/N)*rect(x/a)]*{summation n=1->N [sin(k(n).*x)]}
where, N = 22; x = x1i1+x2i2 (1i,i2 are unit vectors in x and y direction and x1,x2 are x,y coordinates)
Now, I have implemented the equation 70 %, can some one validate if I have been doing right, plus suggest how should I go ahead.
clear all; close all;
x1 = [-50:50]
x2 = [-50:50]
k1 = [550:22:1012]
k2 = [550:22:1012]
b = zeros(2, 101);
for m = 1:101,
p=0
for n = 1:22
k = [k1(n),k2(n)]
x = [x1(m),x2(m)]
p = p+sin(k.*x)
mx=hypot(x1,x2)
end
b(:,m) = p
rect=@(mx,a) ones(1,numel(x)).*(abs(x)<a/2) % Rect Function
q=rect(mx,50)
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by