Skip to content

Instantly share code, notes, and snippets.

@oskar-j
Created June 5, 2015 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oskar-j/cec437851bfbeb8ca4f4 to your computer and use it in GitHub Desktop.
Save oskar-j/cec437851bfbeb8ca4f4 to your computer and use it in GitHub Desktop.
LinkedIn riddle
function f = eq(z)
x=z(1);
y=z(2);
s=z(3);
f(1)=3*x - 24;
f(2)=x + y - 25;
f(3)=y - s - 8;
end
guess=[2 3 4]
[result, fval, exit, output] = fsolve(@eq, guess);
result
% result = 8.0000 17.0000 9.0000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment