Borrar filtros
Borrar filtros

Need Help implementing an equation

1 visualización (últimos 30 días)
Rohan Repale
Rohan Repale el 28 de Mzo. de 2013
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

Respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by