Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 201879

Submitted on 7 Feb 2013

Incorrect

48Size
Leading solution size is 13.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Fail
 
%%
dividend = '122333444455555666666777777788888888999999999';
divisor = 42;
quotient_correct = '2912701058465611111113756614021164023809523';
remainder_correct = 33;
[quotient,remainder]=strdiv(dividend,divisor);
while and(numel(quotient)>0,quotient(1)=='0')
  quotient=quotient(2:end);
end
assert(isequal([quotient_correct ' ' num2str(remainder_correct)],[quotient ' ' num2str(remainder)]))
Error: The variable "ans" is undefined.