gil Fix last commit, added missing files.  almost 8 years ago

Commit id: c23261187f356571c963de72d9a0c784c4dc98ad

deletions | additions      

         

classdef Signal   %SIGNAL Summary of this class goes here   % Detailed explanation goes here     properties   x;   a;   end     methods   function signal = Signal(x,a)   signal.x = x;   signal.a = a;   end     function m = moment(this,n)   m = this.a'*(this.x).^n;   end       end       end           

h=0.1;   x1=0;   x2=x1+h;   a=[1,1]';   range = [x1-2*h,x1+3*h,x1-2*h,x1+3*h];   signal = Signal([x1,x2]',a);   figure;   hold on;   ezplot(s2Curve(signal),range);   scatter(x1,x2);   ezplot( @(x,y) (x-x1).^2+(y-x2).^2-(h/2)^2,range);   ezplot('x',range);   hold off;   % Create xlabel   xlabel('{x_1}');     % Create ylabel   ylabel('{x_2}');     % Create title   title('{h=0.1}');           

function [m] = moment(signal,n)   %MOMENT Summary of this function goes here   % Detailed explanation goes here   m = signal.a'*(signal.x).^n;   end           

function fh = s2Curve( signal )   %S2CURVE Summary of this function goes here   % Detailed explanation goes here   m0 = signal.moment(0);   m1 = signal.moment(1);   m2 = signal.moment(2);   fh = @(x1,x2) m0*(x1.*x2) - m1*(x1+x2)+m2;   end