loops and divisions by 7 and calling function
function [whatsLeft, divisionCount] = divideBySeven(number)
%Enter the code for your function here.
while number < 1
number = number / 7
divisionCount = divisionCount + 1
end
whatsLeft = number
this is my code to call my function:
[whatsLeft, divisionCount] = divideBySeven(256)
I tried to run this and the error was that: Output argument "divisionCount" (and maybe others) not assigned during call to "divideBySeven".function [whatsLeft, divisionCount] = divideBySeven(number)
%Enter the code for your function here.
while number < 1
number = number / 7
divisionCount = divisionCount + 1
end
whatsLeft = number
this is my code to call my function:
[whatsLeft, divisionCount] = divideBySeven(256)
I tried to run this and the error was that: Output argument "divisionCount" (and maybe others) not assigned during call to "divideBySeven". function [whatsLeft, divisionCount] = divideBySeven(number)
%Enter the code for your function here.
while number < 1
number = number / 7
divisionCount = divisionCount + 1
end
whatsLeft = number
this is my code to call my function:
[whatsLeft, divisionCount] = divideBySeven(256)
I tried to run this and the error was that: Output argument "divisionCount" (and maybe others) not assigned during call to "divideBySeven". loops MATLAB Answers — New Questions