Implementing a pseudocode m-file function with two inputs
Convert the following structure plan into a function m-file with two inputs (M and N):
Get M and N values
if M does not equal round(M)
Give error message that inputs must be integers
end if
if N does not equal round(N)
Give error message that inputs must be integers
end if
while remainder of M divided by N is not zero
Set R to the remainder of M divided by N
Set M to be N
Set N to be R
end while
Return final value of N as output
https://brainmass.com/computer-science/matlab/implementing-pseudocode-mfile-function-inputs-26635
Solution Preview
function result=twonumbers(m,n)
%to run the program, type twonumbers(m,n) where m and n are ...
Solution Summary
Help to convert the following structure plan into a function m-file with two inputs (M and N) is given.
Free BrainMass Quizzes
-
We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.
-
Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.
-
This quiz tests your knowledge of basics of MS-Excel.
-
This quiz tests a student's knowledge about C++ operators.
-
This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.