From: tayyab nawaz on
T=9; A=.1; N=5; K_l= -3*N; K_r = 3*(N+1); M=5; k=95;
r=0.05;
sigma=.2;
mu=.3;
lambda=.4;
delta=.2;
%h=@(z)H(k*exp(z))/k;
K=[K_l:K_r];
N_k=length(K);
dx=2*A/N; dt=T/M;

step_x=(2*A)/N;
N_k=length(K);
for j=1:N_k
nu(j)=((K(j)-.5)*step_x);
end

I want to replace nu(j) right hand side with a measure mu:R^2-->R defined as

nu(j)=mu((K(j)-0.5)*step_x,(K(j)+0.5)*step_x);
From: Saurabh Mahapatra on
Hi,

I do not know what your measure function looks like. Hence, I assume a dummy function(that may not satisfy properties for a measure). Please see the usage of a function to do what you are trying to do.

Copy the following code as tryme.m and then >>tryme

function tryme
T=9; A=.1; N=5; K_l= -3*N; K_r = 3*(N+1); M=5; k=95;
r=0.05;
sigma=.2;
mu=.3;
lambda=.4;
delta=.2;
%h=@(z)H(k*exp(z))/k;
K=[K_l:K_r];
N_k=length(K);
dx=2*A/N; dt=T/M;

step_x=(2*A)/N;
N_k=length(K);
for j=1:N_k
nu(j)=measure((K(j)-0.5)*step_x,(K(j)+0.5)*step_x)
end

function nu=measure(alpha, beta)
nu=alpha+beta;
end

end


Thanks,

Saurabh
 | 
Pages: 1
Prev: job submitted, tasks pending
Next: Reg PIV code