Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
13
Task/Nth-root/MATLAB/nth-root-1.m
Normal file
13
Task/Nth-root/MATLAB/nth-root-1.m
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
function answer = nthRoot(number,root)
|
||||
|
||||
format long
|
||||
|
||||
answer = number / root;
|
||||
guess = number;
|
||||
|
||||
while not(guess == answer)
|
||||
guess = answer;
|
||||
answer = (1/root)*( ((root - 1)*guess) + ( number/(guess^(root - 1)) ) );
|
||||
end
|
||||
|
||||
end
|
||||
5
Task/Nth-root/MATLAB/nth-root-2.m
Normal file
5
Task/Nth-root/MATLAB/nth-root-2.m
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
>> nthRoot(2,2)
|
||||
|
||||
ans =
|
||||
|
||||
1.414213562373095
|
||||
Loading…
Add table
Add a link
Reference in a new issue