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 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...
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...
Assume that three loci, each with two alleles (A and a, B and b, C and...
Assume that three loci, each with two alleles (A and a, B and b, C and c), determine the difference in height between two homozygous strains of a plant. These genes are additive and equal in their effects on plant height. One strain (aa bb cc) is 10 cm in height. The other strain (AA BB CC) is 22 cm in height. The two strains are crossed, and the resulting F1 are interbred to produce F2 progeny. Give the phenotypes...
Language: C++ You're given a 1000-line text file, phoneno.txt, where each line consists of a 5-digit...
Language: C++ You're given a 1000-line text file, phoneno.txt, where each line consists of a 5-digit ID# and a phone# in the format of ###-###-####. The data were generated randomly so there might be duplicates in the IDs. You're asked to do the following by using standard library algorithms as much as possible: 1. read the file into a map which has an integer for key (ID#) and a string for value (phone#), this allows the duplicates to be removed....
Consider the following information for stocks A, B, and C. The returns on the three stocks...
Consider the following information for stocks A, B, and C. The returns on the three stocks are positively correlated, but they are not perfectly correlated. (That is, each of the correlation coefficients is between 0 and 1.) Stock Expected Return Standard Deviation Beta A 8.50% 14% 0.7 B 10.50 14 1.1 C 12.50 14 1.5 Fund P has one-third of its funds invested in each of the three stocks. The risk-free rate is 5%, and the market is in equilibrium....
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT