it is really a mental challenge
I don't understand why the size of this code is so huge, can anyone help ?
Hi all,
I have used regular expressions in other languages before but not in MATLAB. Can someone explain the solution to me? I have looked up the format of regexp in the help file, but the use of the regexp in the solution does not seem to fit the description in help.
When I try and run the code in Octave it falls over with an error as it does not recognise the with an 'Invalid call to regexp' error.
Can someone please help!
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
n = 1;
f = 1;
assert(isequal(fib(n),f))
|
2 | Pass |
%%
n = 6;
f = 8;
assert(isequal(fib(n),f))
|
3 | Pass |
%%
n = 10;
f = 55;
assert(isequal(fib(n),f))
|
4 | Pass |
%%
n = 20;
f = 6765;
assert(isequal(fib(n),f))
|
Sum all integers from 1 to 2^n
6337 Solvers
Make a run-length companion vector
453 Solvers
The Answer to Life, the Universe, and Everything
313 Solvers
Matlab Basics - y as a function of x
242 Solvers
213 Solvers