Implementing a pseudocode m-file function with two inputs
Not what you're looking for?
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
Purchase this Solution
Solution Summary
Help to convert the following structure plan into a function m-file with two inputs (M and N) is given.
Solution Preview
function result=twonumbers(m,n)
%to run the program, type twonumbers(m,n) where m and n are ...
Purchase this Solution
Free BrainMass Quizzes
Inserting and deleting in a linked list
This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.
C# variables and classes
This quiz contains questions about C# classes and variables.
Word 2010: Tables
Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.
C++ Operators
This quiz tests a student's knowledge about C++ operators.
Excel Introductory Quiz
This quiz tests your knowledge of basics of MS-Excel.