Cody

Problem 43283. Subtract integers and add doubles

Solution 1018823

Submitted on 16 Oct 2016
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   Fail
a = int8(1); b = int8(2); c = intOrfloat(a, b) assert(isequal(c,-1)) a = 1; b = 2; c = intOrfloat(a, b) assert(isequal(c,3)) a = uint8(1); b = uint8(2); c = intOrfloat(a, b) assert(isequal(c,0)) a = int16(100); b = int16(200); c = intOrfloat(a, b) assert(isequal(c,-100)) a = single(100); b = single(200); c = intOrfloat(a, b) assert(isequal(c,300))

Output argument "c" (and maybe others) not assigned during call to "intOrfloat". Error in TestPoint1 (line 3) c = intOrfloat(a, b)

Suggested Problems

More from this Author15

Community Treasure Hunt

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

Start Hunting!