Question

Solve the following problems in the MATLAB Command Window. Show all of your work and add comments to distinguish each problem
0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB Code

%Your Name
%1. (5-20/7+2.5^3)^2
fprintf('1. (5-20/7+2.5^3)^2\t\t\t\t\t\t=%1.4f\n',(5-20/7+2.5^3)^2)
%2. 6x3.1+120/5-15^(5/3)
fprintf('2. 6x3.1+120/5-15^(5/3)\t\t\t\t\t=%1.4f\n',6*3.1+120/5-15^(5/3))
%3. 8+80/2.6+e^3.5
fprintf('3. 8+80/2.6+e^3.5\t\t\t\t\t\t=%1.4f\n',8+80/2.6+exp(3.5))
%4. [sin(0.2pi)]/[cos(pi/6)]+tan72deg
fprintf('4. [sin(0.2pi)]/[cos(pi/6)]+tan72deg\t=%1.4f\n',sin(0.2*pi)/cos(pi/6)+tan(72*pi/180))
%5. Set t=3.2 and evaluate 0.5e^(3t)+3.82t^3
t=3.2;
fprintf('5. 0.5e^(3t)+3.82t^3\t\t\t\t\t=%1.4f\n',0.5*exp(3*t)+3.82*t^3)
%6. Define x=6.5 and y=3.7 and evaluate [(x+y)^0.5]/[(x-y)^2]-xy^2+2x^2
x=6.5;
y=3.7;
fprintf('6. [(x+y)^0.5]/[(x-y)^2]-xy^2+2x^2\t\t=%1.4f\n',(x+y)^0.5/(x-y)^2-x*y^2+2*x^2)
%7. Define the variables c=4.7,d=1.6,a=cd^2 and b=(c+a)/(c-d) and evaluate
%d/c+(ct/b)^2-c^d-a/b
c=4.7;
d=1.6;
a=c*d^2;
b=(c+a)/(c-d);
fprintf('7. d/c+(ct/b)^2-c^d-a/b\t\t\t\t\t=%1.4f\n',d/c+(c*t/b)^2-c^d-a/b)
%8. (3.61-2.25pi)(log10(589006))
fprintf('8. (3.61-2.25pi)(log10(589006))\t\t\t=%1.4f\n',(3.61-2.25*pi)*log10(589006))

Output on the command prompt

1. (5-20/7+2.5^3)^2                       =315.6967
2. 6x3.1+120/5-15^(5/3)                   =-48.6330
3. 8+80/2.6+e^3.5                       =71.8847
4. [sin(0.2pi)]/[cos(pi/6)]+tan72deg   =3.7564
5. 0.5e^(3t)+3.82t^3                   =7507.5645
6. [(x+y)^0.5]/[(x-y)^2]-xy^2+2x^2       =-4.0776
7. d/c+(ct/b)^2-c^d-a/b                   =-6.0189
8. (3.61-2.25pi)(log10(589006))           =-19.9564

Add a comment
Know the answer?
Add Answer to:
Solve the following problems in the MATLAB Command Window. Show all of your work and add...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Complete the following problems in Matlab environment. Copy your com mand and final answer from MATLAB command window a...

    Complete the following problems in Matlab environment. Copy your com mand and final answer from MATLAB command window and paste them in a word document. Submit a single word document file for the entire HW Problems: Code your own MATLAB program to find the approximate value of the integral J e dr with Trapezoidal rule for N 20, .e., 2 (formula 4.21 on Page 201 YS). Also give the relative error of t2o with de-1. (Hint: For-end loops or Elementwise...

  • MATLAB HELP Solve this problem first by hand and then check your answers in MATLAB. Write...

    MATLAB HELP Solve this problem first by hand and then check your answers in MATLAB. Write the output of the following commands when executed sequentially (i.e. in the order shown, from top to bottom) in the MATLAB command window Expression ans logical a) (6 + 3) >= 8 < 1 11 false 4 > (2 + 9) 11 ~true <- (-2*0.5) 4 + (4 < 7) (3&2) 0) d) e) Given |x= [10, 2, 6, 0, -31: y=[9, 0, 2,...

  • Please show matlab editor and command window B. (4 pts) Use the : operator to create...

    Please show matlab editor and command window B. (4 pts) Use the : operator to create the vectors x [2.5,1.50.5,-0.5,-1.51 and y [0.4,0.8,1.2,1.6,2], then use them in the following expression to compute vector z using element-by-element calculations C. (8 pts) A 70 lb bag of rice is being pulled by applying a force F at an angle θ as shown. The force required to drag the bag is given by: θ μ sin θ + cos θ Where u-0.35 is...

  • This is for Controls Systems class. Please solve everything, and show all work and correct answers...

    This is for Controls Systems class. Please solve everything, and show all work and correct answers and matlab codes for positive rating. A - C, E - F do by hand. D, G-I do in Matlab as instructions direct. (Show codes and plots for matlab solutions too!), show the code and plots obtained for positive rating. Provided below is the Handout 7 equations that are needed for this problem for use. 1. The state space model of a system is...

  • UOR 8ver the commands and examples in the Matlab Overview documents available on Blackboard Matla...

    number 2 using mathlab UOR 8ver the commands and examples in the Matlab Overview documents available on Blackboard Matlab folder, and then complete the assignment. You should turn in your entire command window text format, please) cither printed or by email. I need to be able to see both your com Use Matlab to perform as many calculations as possible, including determining whether an operation Make your calculations as efficient as possible. Look for ways to avoid entering Matlab results...

  • Exercise 1: Use Matlab command to obtain the following a) Extract the fourth row of the...

    Exercise 1: Use Matlab command to obtain the following a) Extract the fourth row of the matrix generated by magic(6) b) Show the results of 'x' multiply by 'y' and 'y' divides by 'x'. Given x = [0:0.1:1.1] and y=[10:21] c) Generate random matrix 'r' of size 4 by 5 with number varying between -8 and 9 Exercise 2: Use MATLAB commands to get exactly as the figure shown below x=pi/2:pi/10:2*pi; y=sin(x); z=cos (x);

  • 1.1 (20 points) Set the data format to be short. Calculate the following problems in the...

    1.1 (20 points) Set the data format to be short. Calculate the following problems in the Matlab Command Window. Show (14.8 +6.5)155 your Matlab code and answer. (a) 3.8° 72 +14 (b) +20613 In 524 1.2 (20 points) Set the data format to be short. Calculate the following problems in the Matlab Command Window. Show (€250 +23) the Matlab code and answer. (a) tan" In ووسکه ای (b) Sot 71 6 cos sin abc b da (a) 'e+d* -2-bºc+d) 1.3...

  • matlap Question 1 1. Consider the following Matlab program 5 - (2 < 3) & (C2...

    matlap Question 1 1. Consider the following Matlab program 5 - (2 < 3) & (C2 > 3) 1 (1 - 0)) What is the final value of s? A. True B. *1 CO D. false 2- Which expression tests whether variable x is between (but not the same as) the values 5 and 10 (a) 5 <x< 10 (b) 5 <= x <= 10 (c) 5 < X & X > 10 (d) x < 10 & 5 <...

  • solve these questions by Matlab 10 9:17 X ull ** - STC Report Lab - للقراءة...

    solve these questions by Matlab 10 9:17 X ull ** - STC Report Lab - للقراءة فقط (1) 28 Hoď → 7 سجل دخولك لتحرير الملف وحفظ التغييرات ا... Problems Problem 1: The following polynomials are given: Py(x) = x + 2x4 - 3x + 7x2 - 8x + 7 Polx) = x + 3x - 5x2 + 9x + 11 P3(x) = x - 2x - 3x +9 P4(x)=x2-5x + 13 Ps(x) = x + 5 Use MATLAB functions...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT