Where did I do wrong?
The desired results are not the character strings 'true' and 'false' but the logical values true and false.
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
%%
a = [2 3 4];
assert(isequal(isItSquared(a),true))
Error: Assertion failed.
|
2 | Fail |
%%
a = [20:30];
assert(isequal(isItSquared(a),false))
Error: Assertion failed.
|
3 | Fail |
%%
a = [1];
assert(isequal(isItSquared(a),true))
Error: Assertion failed.
|
4 | Fail |
%%
a = [6 10 12 14 36 101];
assert(isequal(isItSquared(a),true))
Error: Assertion failed.
|
5 | Fail |
%%
a = [6 10 12 14 101];
assert(isequal(isItSquared(a),false))
Error: Assertion failed.
|
Select every other element of a vector
20350 Solvers
Return the 3n+1 sequence for n
6168 Solvers
309 Solvers
326 Solvers
Number of Even Elements in Fibonacci Sequence
665 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!