Question

Determine the result you would get by typing the following arithmetic expressions into MATLAB. Assume x=4...

Determine the result you would get by typing the following arithmetic expressions into MATLAB. Assume x=4 and y=2.
a. 3 ^2 – 1


b. 4 +4 / 2 – 1


c. x +4 * y


d. y ^ ( x – 1)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a. 3 ^2 – 1

8


b. 4 +4 / 2 – 1

-4


c. x +4 * y

12


d. y ^ ( x – 1)

8

matlab\;code:

x = 4;
y = 2;

3 ^2 - 1
3 ^2 - 14 +4 / 2 - 1
x +4 * y
y ^ ( x - 1)

ans8 ans12 ans= 8

Add a comment
Know the answer?
Add Answer to:
Determine the result you would get by typing the following arithmetic expressions into MATLAB. Assume x=4...
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
  • Problem 1: Calculate in MATLAB arithmetic expressions given by problems 4 (a and b) and 5...

    Problem 1: Calculate in MATLAB arithmetic expressions given by problems 4 (a and b) and 5 (a and b) on pages 27-28 of Gilat's book. Note that MATLAB has two sets of trigonometric function with arguments in degree (like cosd() and radian (like cos). 4. Calculate: 2.32.1.7 (b) 234 +12.7(592-2.47) +9.81n51 W-082)2+(2-4687)İ -082)(2-/0.87)2

  • 2.* Let x -5- 8i and y 10-5i. Use MATLAB to compute the following expressions. Hand-check...

    2.* Let x -5- 8i and y 10-5i. Use MATLAB to compute the following expressions. Hand-check the answers. a. The magnitude and angle of y. b. The magnitude and angle of 3.* Use MATLAB to find the angles corresponding to the following coordinates. Hand-check the answers. a. (x, y) (5, 8) b. (x,y)(-5, 8) c. (x) (5,-8) d. (x,y)=(-5,-8) 4. For several values of x, use MATLAB to confirm that sinh x (e-e )/2

  • a) Generate the truth table for the following Boolean expressions and display it in the MATLAB...

    a) Generate the truth table for the following Boolean expressions and display it in the MATLAB command window (Use logical functions: and, not, or) X (A. B) (C. D) Y-ACD b) Solve the following questions and hence to verify your calculated result. (You may use bi2de, de2bi, hex2dec and dec2hex) i Convert the binary number 10011011into decimal ii) Convert the decimal number 137 into binary Convert the hexadecimal number A4C3 into decimal iv) Convert the decimal number 52710 into hexadecimal.

  • 4. Assume the following rules of associativity and precedence for expressions: Precedence Highest *, /, not...

    4. Assume the following rules of associativity and precedence for expressions: Precedence Highest *, /, not +,-,&, mod - (unary) =,/=,<,<=,>=,> and or, xor Lowest Associativity Left to right Show the order of evaluation of the following expressions by parenthesizing all sub expressions and placing a superscript on the right parenthesis to indicate order. For example, for the expression a+b*c+d the order of evaluation would be represented as ((a+(b*c)1)2 +d)3 a * b - 1 + c a * (b...

  • 1. Consider the following BNF definition of arithmetic expressions: <expression> <expression>+ <term> | <expression>-<term> <term> <term>...

    1. Consider the following BNF definition of arithmetic expressions: <expression> <expression>+ <term> | <expression>-<term> <term> <term> ::= <term>*<factor> <term>/<factor> | <factor> <factor> :: <digit>«<exponent> | <didgit>^«<exponent> <digit>(<expression> <digit>:= 01|2|3|4151617181910. <exponent> :: <sign> <val> <sign>=+1 - <val 1121314 Draw the expression trees of the following expressions, parsed according to the BNF above. a) 46 - 6/4-243. b) 4*6 -(6/4 - 243) c) 31-2-3*2 + 3/2 d) 3^2*5. e) ((3^2)).

  • 3. Consider the following BNF for arithmetic expressions: <expression> ::= <term> <term>+ <expression> | <term> -...

    3. Consider the following BNF for arithmetic expressions: <expression> ::= <term> <term>+ <expression> | <term> - <expression> <term> ::= <factor> | <factor> * <term> | <factor> I <term> <factor> ::= <constant> (<expression>) <constant ::= 0|1|2|3|4|5|6789 a) Show the expression tree of the following expression: 8/7*5/6-6/4/2-7*(5+2). b) Give the value of this expression. c) Same question as (a), if the BNF were <expression> ::= <term> | <expression>+ <term> | <expression> - <term> <term> ::= <factor> | <term>*<factor> | <term> / <factor>...

  • Required information Use MATLAB to create a state variable model and obtain the expressions for the...

    Required information Use MATLAB to create a state variable model and obtain the expressions for the matrices A, B, C, and D. Consider the following equation to obtain the state model: Y() F(x) The input is no) and the output is y. Multiple Choice A = [0 1.25], B- - [8], 0 - 1 - 2 - 3 and D -(0) O A-173],3-[a] .c -60, and D - 10 1.25) A-[7.], B-[].C-10 1.25), and D - (0) A-10), B =[],c-[72]...

  • Start Typing in MATLAB Use MATLAB: 1.) Determine if the vectors V1 = (2,-1,2,3), V2 =...

    Start Typing in MATLAB Use MATLAB: 1.) Determine if the vectors V1 = (2,-1,2,3), V2 = (1,2,5, -1), V3 = (7,-1,5,8) form a basis for R4. Type: BA1 = [2 – 1 2 3;1 2 5 – 1;7 -15 8]' BAR1 = rref(BA) If you decide that V1, V2, V3 form a basis for R, type: ANBA1= 1 Otherwise type: ANBA1=0 2.) Determine if the vectors V1 = (1,2,3), V2 = (2,9,0), V3 = (3,3,4) form a basis for Rº....

  • We are the four computed values of f, IEEE floating point arithmetic is used? You can assume that...

    We are the four computed values of f, IEEE floating point arithmetic is used? You can assume that exp(x) and exp(-x) are calculated exactly and rounded to the nearest floating point number The following lines of MATLAB code evaluate the function 1.5 1016 in four different ways (a) x=1.5e-16; f=0.5*((exp (x)-exp (-x))/x) (b) x -1.5e-16; f - 0.5*((exp(x)-exp(x))/((xt1)-1)) (c) x - 1.5e-16; 0.5* ((exp(x) -exp(-x))/((x-1)+1)) (d) x - 1.5e-16; fexp(x)-exp(-x))/((x+1)+(x-1)) What are the four computed values of f, if IEEE...

  • Compute the following problems using Math Lab.   Instructions: Answer All Questions using MATLAB commands. Question 1....

    Compute the following problems using Math Lab.   Instructions: Answer All Questions using MATLAB commands. Question 1. Create a vector of the even whole numbers between 31 and 75. Question 2. Let x [2516] a. Add 16 to each element b. Add 3 to just the odd-index elcments c. Compute the square root of each element d. Compute the square of each element Question 3. Let x 13 268T and y [4 1 3 5] (NB. x and y should be...

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
ADVERTISEMENT