Cody

Problem 44683. Perfect square.

Solution 1556408

Submitted on 11 Jun 2018
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
x = 0; y_correct = 1; assert(isequal(your_fcn_name(x),y_correct))

2   Pass
x = 1; y_correct = 1; assert(isequal(your_fcn_name(x),y_correct))

3   Pass
x = 7; y_correct = 0; assert(isequal(your_fcn_name(x),y_correct))

4   Pass
x = 343; y_correct = 0; assert(isequal(your_fcn_name(x),y_correct))

5   Pass
x = pi; y_correct = 0; assert(isequal(your_fcn_name(x),y_correct))

6   Pass
x = exp(1); y_correct = 0; assert(isequal(your_fcn_name(x),y_correct))

7   Fail
x = sqrt(-1); y_correct = 0; assert(isequal(your_fcn_name(x),y_correct))

Error using mod Arguments must be real. Error in your_fcn_name (line 2) ~mod(sqrt(x),1); Error in Test7 (line 3) assert(isequal(your_fcn_name(x),y_correct))

8   Pass
x = 2025; y_correct = 1; assert(isequal(your_fcn_name(x),y_correct))

9   Pass
x = 4761; y_correct = 1; assert(isequal(your_fcn_name(x),y_correct))

Suggested Problems

More from this Author1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!