this is for holding javascript data
gil Fix last commit, added missing files.
almost 8 years ago
Commit id: c23261187f356571c963de72d9a0c784c4dc98ad
deletions | additions
diff --git a/matlab/Signal.m b/matlab/Signal.m
new file mode 100644
index 0000000..a9ff3d2
--- /dev/null
+++ b/matlab/Signal.m
...
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
diff --git a/matlab/hyplot.m b/matlab/hyplot.m
new file mode 100644
index 0000000..f88d541
--- /dev/null
+++ b/matlab/hyplot.m
...
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}');
diff --git a/matlab/moment.m b/matlab/moment.m
new file mode 100644
index 0000000..0169d14
--- /dev/null
+++ b/matlab/moment.m
...
function [m] = moment(signal,n)
%MOMENT Summary of this function goes here
% Detailed explanation goes here
m = signal.a'*(signal.x).^n;
end
diff --git a/matlab/s2Curve.m b/matlab/s2Curve.m
new file mode 100644
index 0000000..92493ac
--- /dev/null
+++ b/matlab/s2Curve.m
...
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