Write a matlab code using the switch statement

Assignment Help MATLAB Programming
Reference no: EM132070084

Questions

1. Evaluate the following mathematical expression using MATLAB commands. Display your results by omitting semicolons at the end of your command lines.

1/4√52+ 62/3;

R = (8x3√x + 51/3x2)/x√x+41/3x2/3

where x = 3√(200 - 4√2 + 3(√99 - 3√5))

2. Solve the following system of equations using the MATLAB functions or operators:

2x-y+3z-t -3

x-2y-2z-3t = 2

5x -3y- z +2t = 3

3x-Fy+z+4t=7

Verify your solution using matrix multiplication.

3 Input the matrices

1970_matrix.jpg

(a) Using MATLAB functions, verify that det(A) det(B) = det(AB) ;

(b) Calculate AB and 3ATB-1- 3B.

4 Write a MATLAB script to produce the graphs of the functions y1 = 2x-2 , y2 = x2 - 2 + 2 and y3 = -x3 in the range of -3:0.013 using the same axes. Use the MATLAB functions xlabel, ylabel.legend and title to annotate your graph clearly.

5. Use the surf function to plot z = x2/(1+y2), for, =-5:01 :5 and y =-5:0.1:5.

6. Write a MATLAB script to plot the piece-wise function of given by:

f(x) = 3x2 - Π2/4
f(x) = 4cosx + Π2  -Π/2 ≤ x ≤ Π/2
f(x) = x2 + Π2/4    x < -Π/2

x varies between -Π and Π with 100 data points.

7. For x = 1:10 calculate y = e0.2x, use fopen and fprintf to write x and y data into a file named "my ex_data . dat". Then use fopen and fscanf to read the x and y data. Show the data in 2 columns.

8. Write a MATLAB code using the switch statement to show whether a day of the week is a week day or weekend day. The day of the week is read in from the user as a string. Monday, through Friday are assumed to be week days and Saturday and Sunday are assumed to be weekend days.

9. We know that 1 - 1/3 + 1/5 -1/7 + = 1/4Π. How many terms do we need to have in order for the error to be smaller than 10-4? Write a MATLAB code to find out.

10. Write a MATLAB program that will display the numbers from 1 to 1000 which are cubic numbers (such as 8 = 2*2*2). The program should display: 1, 8, 27, .... Run your program and verify that it operates correctly.

Reference no: EM132070084

Questions Cloud

How much will jenny have to invest each month : Jenny is planning to retire at 65 and her goal is to have $750,000 in her 403b when she retires. How much will Jenny have to invest each month if she earns 9%?
Making a capitol investment decision : What parts of financial statements are looked at when making a capitol investment decision?
What is the required dollar amount and long or short : What is the required dollar amount and long or short in this option and in futures?
Percentage of total assets at the typical bank : Why are loans such a high percentage of total assets at the typical bank? What four broad classes of loans do banks engage in?
Write a matlab code using the switch statement : Solve the system of equations using the MATLAB functions or operators - Write a MATLAB script to plot the piece-wise function
Calculate the net income for proposed project : Calculate the net income for this proposed project. (Round to two decimal places)
What is the expected return of stock : The firm pays out 50% of its earnings as dividends. What is the expected return of this stock?
Cash flow analysis of a new product : Out of the following items which should NOT be included in the cash flow analysis of a new product?
What level of sales : Oliver Industries reported net income of $75 million in 2017. The company's corporate tax rate was 40% and its interest expense was $25 million.

Reviews

len2070084

7/30/2018 5:31:16 AM

Please organise the Assignment as follows: Scan these into a "single".pdf file. You can reduce the file size by up to 50% as a jpeg option when saving the file. Use a low scan resolution of 75 or 150 dpi for individual pages to keep the combined file below a few MB so you do not run into file size errors in the mail program (files above 8 MB will be rejected and the student asked to resubmit the file within the size limit). Submit the single file through Moodie in the Assignment Submission page. total of 10 questions. Each carries 2 marks

len2070084

7/30/2018 5:30:59 AM

All answers require a clear justification in order to receive marks. For each question, provide complete step-by-step workings that clearly show the means by which the solutions were obtained. Trial and error will not be accepted as a justification. However, it is a good idea to check your answers where you are able. Because this assignment requires MATLAB programming, you need to type your source codes and detailed workings and include final results (including plots if required) in each question. Therefore no hand-written materials will be accepted.

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd