Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
.
  • Loading branch information
mattmaliniak committed Dec 14, 2017
1 parent be8747c commit 3fbaa55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
15 changes: 6 additions & 9 deletions Part G/part_g.asv
Expand Up @@ -9,12 +9,9 @@ for i = 1:length(P)
end
clf
setDefaults
plot(wmax,P,'o')
%P_out = interp1(wmax,P,linspace(.1,.3),'pchip');
hold on
%plot(linspace(.1,.3),P_out)
x = wmax;
y = P;
Z = x.^3;
a = Z/
hold off
x = wmax';
y = P';
Z = [x.^0, x.^3];
a = Z\y;
x_fcn = linspace(min(x),max(x));
plot(x,y,'o',x_fcn,a(1)+a(3)*x_fcn.^2)
10 changes: 5 additions & 5 deletions Part G/part_g.m
Expand Up @@ -9,9 +9,9 @@ for i = 1:length(P)
end
clf
setDefaults
x = wmax;
x = wmax';
y = P';
Z = [x.^3]';
a = Z\y;
x_fcn = linspace(min(x),max(x));
plot(x,y,'o',x_fcn,a.*x_fcn)
Z=x.^3;
a=Z\y;
x_fcn=linspace(min(x),max(x));
plot(x,y,'o',x_fcn,a*x_fcn.^3)

0 comments on commit 3fbaa55

Please sign in to comment.