I am writing euler lagrange function for minimization. I always have a problem running the code when i use functions.
When i press run it tells"Type code to run" What should i do ?
Here is my code
function [u] = heat (f)
subplot(121);
imagesc(f); title('Original'); colormap gray;
dt = 0.01;
T = 5;
u = f;
[m,n] = size(u);
for t = 0:dt:T
u_xx = ( u(:,[2:n,n]) - 2*u + u(:,[1,1:n-1]) ) / 2;
u_yy = ( u([2:m,m],:) - 2*u + u([1,1:m-1],:) ) /2;
u = u + dt*( u_xx + u_yy);
subplot(122);
imagesc(u); title(['t=',num2str(t)]); pause(0.1);
end;
end