Computer Science Homework Solutions
Problem
#26635

convert structure to matlab m-file

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

Solution
What is this?
By OTA - Overall OTA Rating
Ravindra Koggalage, PhD (IP) - 4.9/5
Purchase Cost Now
$2.19 CAD (was ~$15.96)
Included in Download
  • Plain text response
  • Attached file(s):
    • twonumbers.m
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • Algorithms - Trace the action of the algorithm BabylonianSQRT for the following input values of a and error = 0.001: a. a = 6 b. a = 23 c. a = 16
  • Java code to check multiples (and factors) of numbers - Problem Given: Write an application that reads two integers and determines whether the first is a multiple of the second and print the result. (Hint: Use the remainder operator)
  • Algorithms - Trace the action of the algorithm NaiveGCD for the following input pairs. a. (24,108) b. (23,108) c. (89,144) d. (1953,1937) Exercise 1.8: Repeat Exercise 1.7 for the algorithm Eu ...
  • Cyclic Redundancy Checks - Cyclic Redundancy Checks (CRC) can provide strong capabilities to digest a message in such form that if bits in the message have become corrupted during transmission, then the receiver will be able ...
  • JAVASCRIPT PROBLEM - Validate.js problem I get an error message on IE. On Firefox, it never gives me an error for the date. Please double-check my expiration date check logic, because when I select 01/2007 I get an e ...
Browse