Question

Please do this in MATLAB with the if-else conditions. You're given three integers, a, b and...

Please do this in MATLAB with the if-else conditions.

You're given three integers, a, b and c. It is guaranteed that two of these integers are equal to each other. What is the value of the third integer? The filename is Exer1 and Exer2

Homework Answers

Answer #1

Matlab code:

a=input("Enter a value");
b=input("Enter b value");
c=input("Enter c value");
if a==b
    fprintf("a and b are equla c vaulue is %d",b);
elseif b==c
    fprintf("b and c are equla a vaulue is %d",a);
else
    fprintf("a and c are equla b vaulue is %d",b);
end

Output Screenshot:

Thank you have a great Day....:)-

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Create a MATLAB program to answer the given problem You're given three integers, a, b and...
Create a MATLAB program to answer the given problem You're given three integers, a, b and c. It is guaranteed that two of these integers are equal to each other. What is the value of the third integer?
using Matlab 1) use the if/else structure to solve these problems (a,b) a) write a programme...
using Matlab 1) use the if/else structure to solve these problems (a,b) a) write a programme that reads an integer from the user. then your program should display a message whether the integer is even or add. b) many solid-fuel rocket motors consist of three stages. Once the first stages burns out, it separates from the missile and the second stage lights. then the second stages burns out and separate and the third stage light.Finally, once the third stages burns...
(Please answer everything and with explanation) Mathematical expressions that evaluate to even and odd integers. In...
(Please answer everything and with explanation) Mathematical expressions that evaluate to even and odd integers. In the expressions below, n is an integer. Indicate whether each expression has a value that is an odd integer or an even integer. Use the definitions of even and odd to justify your answer. You can assume that the sum, difference, or product of two integers is also an integer. (a) 2n + 4 (b) 4n+3 (c) 10n3 + 8n - 4 (d) -2n2...
Three positive integers a, b and c have, in pairs, highest common factors (a,b) = 24,...
Three positive integers a, b and c have, in pairs, highest common factors (a,b) = 24, (b,c) = 198 and (a,c) = 210. (a) What is the highest common factor of a, b and c? (b) Find the smallest values of a, b and c which satisfy the given criteria.
The following function compares integers of type int and gives as a result the smaller Number:...
The following function compares integers of type int and gives as a result the smaller Number: int min (int a, int b) { if (a < b) return a; else return b; } Create a template and Convert this function to a template. Before converting this function to a template, display how you would handle var a & b if they held the same value. In other words if a and b are equal, what would you do (how would...
Combinatorial Math: Find the number of nonnegative integer solutions to the equation a+b+c=249. We are given:...
Combinatorial Math: Find the number of nonnegative integer solutions to the equation a+b+c=249. We are given: 10 ≤ a ≤ 30  (you can use an ellipsis between values in this factor instead of listing them all) b is even and b > 50 c ≥ 144 a) Set up the generating function. Do not multiply it out. Do not use a, b or c in the function. Use x as the variable. The first factor should relate to a, the second...
The following data represent the results from an independent-measures experiment comparing three treatment conditions. Use SPSS...
The following data represent the results from an independent-measures experiment comparing three treatment conditions. Use SPSS to conduct an analysis of variance with α=0.05α=0.05 to determine whether these data are sufficient to conclude that there are significant differences between the treatments. Treatment A Treatment B Treatment C 2 4 5 4 2 7 4 4 8 2 7 9 3 3 11 F-ratio = p-value = Conclusion: These data do not provide evidence of a difference between the treatments There...
Problem Definition: Problem: Given an array of integers find all pairs of integers, a and b,...
Problem Definition: Problem: Given an array of integers find all pairs of integers, a and b, where a – b is equal to a given number. For example, consider the following array and suppose we want to find all pairs of integers a and b where a – b = 3 A = [10, 4, 6, 16, 1, 6, 12, 13] Then your method should return the following pairs: 4, 1 15, 12 13, 10 A poor solution: There are...
The following data represent the results from an independent-measures experiment comparing three treatment conditions. Use a...
The following data represent the results from an independent-measures experiment comparing three treatment conditions. Use a spreadsheet to conduct an analysis of variance with α=0.05α=0.05 to determine whether these data are sufficient to conclude that there are significant differences between the treatments. Treatment A Treatment B Treatment C 12 12 16 12 11 18 12 13 15 11 14 17 13 15 19 F-ratio = p-value = The results obtained above were primarily due to the mean for the third...
Consider a company considering a project that will last three years A. If the project will...
Consider a company considering a project that will last three years A. If the project will return $30 million a year for the next three years and the cost interest rate is 8%, what is the value of these cash flows? B. Suppose instead the project will return $20 million at the end of the first year and at the end of the second year, and $40 million at the end of the third year. No other be Guaranteed. If...