Skip to content

Instantly share code, notes, and snippets.

@Redchards
Last active August 29, 2015 14:18
Show Gist options
  • Save Redchards/a3992f34f575860eeede to your computer and use it in GitHub Desktop.
Save Redchards/a3992f34f575860eeede to your computer and use it in GitHub Desktop.
x=[1000:9999];
v=zeros(1,9000);
v=v+floor(x./1000).^4;
v=v+(floor(x./100)-floor(x./1000)*10).^4;
v=v+(floor(x./10)-floor(x./100)*10).^4;
v=v+(x-floor(x./10)*10).^4;
v(find(v==x))
function x=triu_linsolve(M, y)
M=M'
y=y'
x=zeros(length(y), 1)
if(M(1, 1)~=0) then x(1)=y(1)/M(1,1)
for i=2:length(y)
end
endfunction
function L=polybases(x, i)
X=poly(0, 'X');
y=x(i);
x(i)=[];
L=prod(X-y)/prod(y-x);
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment