1. Write a function in MATLAB that will calculate and return the slope and y-axis intercept...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Write a function in MATLAB that will calculate and return the slope and y-axis intercept from coordinate values. The inputs to the function are the coordinate values. Hint: The equation of a straight line: y = mx + b; where m is the slope of the line, (m=2-V) x2-x1 and b is the y-intercept (b = y -mx). Your function definition should look like this: function [m bl=eline (x1, yl, x2, y2) 2. Write a function that prints a statistical report for a vector 'a'. The report includes average, minimum, maximum value. Please print the report from the function. Your function definition should look like this: function statreport (a) 3. Write a function to calculate whether a given number is a prime number (code/logic to calculate the prime number is provided in class activity 9). Please do not use the built-in MATLAB function 'isprime'. 4. Write a function to convert a Fahrenheit temperature to a Celsius temperature. 5. Upload the file named 'SanAntonio_temp.xlsx' into Octave. Read data. Find the maximum and minimum of average temperatures. Plot temperatures. Call the function you wrote for Q4 to convert temperatures from Fahrenheit to Celsius. Write the maximum and minimum Celsius temperatures to a text file. 1. Write a function in MATLAB that will calculate and return the slope and y-axis intercept from coordinate values. The inputs to the function are the coordinate values. Hint: The equation of a straight line: y = mx + b; where m is the slope of the line, (m=2-V) x2-x1 and b is the y-intercept (b = y -mx). Your function definition should look like this: function [m bl=eline (x1, yl, x2, y2) 2. Write a function that prints a statistical report for a vector 'a'. The report includes average, minimum, maximum value. Please print the report from the function. Your function definition should look like this: function statreport (a) 3. Write a function to calculate whether a given number is a prime number (code/logic to calculate the prime number is provided in class activity 9). Please do not use the built-in MATLAB function 'isprime'. 4. Write a function to convert a Fahrenheit temperature to a Celsius temperature. 5. Upload the file named 'SanAntonio_temp.xlsx' into Octave. Read data. Find the maximum and minimum of average temperatures. Plot temperatures. Call the function you wrote for Q4 to convert temperatures from Fahrenheit to Celsius. Write the maximum and minimum Celsius temperatures to a text file.
Expert Answer:
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date:
Students also viewed these programming questions
-
New Century Coffee ( NCC ) Company is a 1 2 4 - store coffee retailer headquartered in San Jose and operating throughout 5 western states. Its stores are known for their stylish and artistic...
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
Suppose a parent was earning $20,000 per year working at a local firm. The parent then decides to quit his job in order to care for his child, who was being watched by a babysitter for $10,000 per...
-
Determine the reactions at the beam supports for the given loading when wO = 400 lb/ft. 300 lb/ft A. 5 ft
-
Solve the following pairs of simultaneous equations: 1. x + y = 25 y=x+5 2. x + y = 25 y=x-5 3. x + y = 25 y = 2x + 5 4. x + y = 25 y=2x-5 5. x + y = 17 y=x+5 6. x+ y = 17 y=x-5 7. 2x + y = 17 y=x+5...
-
Verify that the computing formulas for \(S S T, S S(T r)\), \(S S(B l)\), and \(S S E\), given on page 409 , are equivalent to the corresponding terms of the identity of Theorem 12.2. Data From...
-
Cray Company started year 2 with $60,000 in its cash and common stock accounts. During year 2 Cray paid $45,000 cash for employee compensation. Assume this is the only transaction that occurred in...
-
Discuss the role of autonomous maintenance within the TPM framework. How does this approach empower operators and improve overall equipment effectiveness (OEE), and what training and cultural changes...
-
On November 1, 1755, Lisbon was destroyed by an earthquake, which killed 90,000 people and destroyed 85% of the city. It was one of the most destructive earthquakes in history. The energy released...
-
Describe the types of paper-based tools a salesperson might use to supplement information for the prospect.
-
Briefly describe how Medicare pays for the following: a. Inpatient services b. Physician services
-
a. What is the purpose of the statement of changes in equity? b. What is its basic format?
-
Explain the value-added product-selling model. List some of the ways salespeople can add value to their product with one or more intangibles.
-
What is the best attitude toward closing a sale?
-
A partition of a positive integer n is a way to write n as a sum of positive integers where the order of terms in the sum does not matter. For instance, 7 = 3 + 2+1 + 1 is a partition of 7. Let Pm...
-
Describe the Operations (+,,*,/) that can cause negligible addition (NA), error magnification (EM), or subtractive cancellation (SC) in calculating ?((x^2)+1) - x . Give the range of where they might...
-
Compute the determinant of the following matrix by co-factor expansion: A = 2 1 -5 2 8 3 -4 2 11 2 11 -3 = 1 2 -1 2
-
In this problem, you are going to use RK4 to find the minimum value of the solution of a third-order ordinary differential equation. Consider the solution of the differential equation subject to the...
-
Write a MATLAB program that uses implicit Euler and centered finite differences to solve the diffusionreaction equation subject to c(0, t) = 1, c(1, t) = 1, and c(x, 0) = 1. at 2 2 = D. - Kc (7.2.31)
-
Political scientists are interested in knowing what factors affect voter turnout in elections. One such factor is the unemployment rate. Data collected in presidential election years since 1964 show...
-
You are the manager of a large department store. Over the years, youve found a strong correlation between your September sales and the number of employees youll need to hire for peak efficiency...
-
Youve been hired by your colleges alumni association to research how past contributions were associated with alumni income and years that have passed since graduation. It is found that R 2 = 0.36....
Study smarter with the SolutionInn App