function [energy] = diavasma4(start,step,stop) x = start:step:stop ; y = x - cos(x) ; plot(x,y) sum = 0; for i = 1:length(y) sum = sum + y(i)^2; end energy = sum; end

function [energy] = diavasma4(start,step,stop) x = start:step:stop ; y = x - cos(x) ; plot(x,y) sum = 0; for i = 1:length(y) sum = sum + y(i)^2; end energy = sum; end

Posted in Uncategorized