Question

7 Write codes to do the following calculation. (15 if xs 20 if 20<xS 40 if 40<xS 60 if x 60 20 y 60-x C 10000, following 8. W
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Commands >> X=14; y0* [x<20]+(x-20)*[x>20 && x<=40]+(60-x)* [x>40 && x<=60]+0* [x>60] >> y = >> x=23; >> y 0* [x<=20]+(x-20)*Commands >> A zeros (100,100); for i-1:100 for j-1:100 A (i,j) (i-1)*100+j; end end >> Acoded in command prompt

Add a comment
Know the answer?
Add Answer to:
7 Write codes to do the following calculation. (15 if xs 20 if 20<xS 40 if...
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
  • Consider the following BST: 50 30 70 20 40 60 80 15 35 65 36 64...

    Consider the following BST: 50 30 70 20 40 60 80 15 35 65 36 64 66 QUESTION 32 child of node Referring to the tree above, the value 62 would be inserted as the (left or right) left or right: node: QUESTION 33 Referring to the original tree above (the exact tree in the picture), which nodes are the predecessor and successor of 50 if 50 was deleted. predecessor: successor: QUESTION 34 Referring to the original tree above (the...

  • Write MARIE assembly language programs that do the following: I. Write a program that inputs thre...

    Write MARIE assembly language programs that do the following: I. Write a program that inputs three integers, a, b, and c, in that order. It computes the following ia-bi-fc+ c The result should be written to output 2. Write a program that inputs integers, s. y, and z. It outputs the difference of the langest and first element entered. You may assume x. y, and z all have different values. So if 8, 12, and 9 are input, the output...

  • S.A vector IS givell by [5, 17,-3, 8, 0,-7, 12, 15, 20,-6, 6, 4,-7, 16]. Write...

    S.A vector IS givell by [5, 17,-3, 8, 0,-7, 12, 15, 20,-6, 6, 4,-7, 16]. Write a program as a 3 or 5, and, raises to the power of 3 the elements that are script tile that doubles the elements that are positive and are divisible by negative but greater than -5. following values. The value of each element in the first row is the number of the 6. Write a program in a script file that creates an matrix...

  • Question 7 1 pts Two infinite plates with surface charge densities to and -20 are shown...

    Question 7 1 pts Two infinite plates with surface charge densities to and -20 are shown below. Determine the direction of the net electric field in each region. (Answers take the form of Region 1, Region 2, Region Region 1 Region 2 Region 3 + + 7 8 x (nm) -5 -4 -3 + 9 -2 -1 6 10 None of the other answers is Right Left, Right Left, Right Right Left, Right, Left Right, Right, Left Question 8 1...

  • Construct a vertical axis (rise axis) and a horizontal axis (run axis). Assign a value of...

    Construct a vertical axis (rise axis) and a horizontal axis (run axis). Assign a value of 0 (zero) where they meet. On the vertical axis list the following prices from bottom to top: $2, $4, $6, $8, $10, $12, and $14 On the horizontal axis list the following quantities from left to right: 10, 20, 30, 40, 50, and 60 Plot the data below on your graph, and answer the following questions: 1. At what price does equilibrium occur? 2....

  • Problem 1 Write a Python program to do the following: (A) Ask the user to enter...

    Problem 1 Write a Python program to do the following: (A) Ask the user to enter as many integers from 1 to 10 as he/she wants. Store the integers entered by the user in a list. Every time after the user has entered an integer, use a yes/no type question to ask whether he/she wants to enter another one. (B) Display the list. (C) Calculate and display the average of the integers in the list. (D) If the average is...

  • LarPCalc8 8.1.012 45 points 1. Determine the order of the matrix. 47 15 0 -1 0 3 3 6 7 -3 1 O-15 points LarPCalc8...

    LarPCalc8 8.1.012 45 points 1. Determine the order of the matrix. 47 15 0 -1 0 3 3 6 7 -3 1 O-15 points LarPCalc8 8.1.020. 2. Write the augmented matrix for the system of linear equations. {Sx 4y-2z 24 -21y +8z -3 8x + O-15 points LarPCalc8 8.1.022 My Nete 3. Write the system of linear equations represented by the augmented matrix. (Use the variables x, y, z, and w, if applicable.) 7 -5-4 3 39 8 O-5 points...

  • Need help on this Matlab problem, I do not know how to do it Problem 2....

    Need help on this Matlab problem, I do not know how to do it Problem 2. (2D Sorting) The following table contains the scores for the 4 students A,B.C and D for four Homeworks HW1 50 20 85 65 HW2HW 45 80 30 95 HW4 75 35 15 80 Student A Student B Student C Student D 40 60 100 a) Create a matrix with the above data b) What is the minimum score of all four homework? (use the...

  • Please answer the following question in detail and show the steps used to do derive the...

    Please answer the following question in detail and show the steps used to do derive the correct answer. Please show all work and circle final answer. l T-Mobile 21:04 Exit A charge of +8 micro-coulombs is placed at the bottom left corner of a rectangle, a charge of -8 micro-coulombs is placed at the top left corner of a rectangle, a charge of +7 micro-coulombs is placed at the bottom right corner of a rectangle, and a charge of +7...

  • 8. Ann x n matrix that is filled with the numbers 1,2,3, ....n2 is a magic...

    8. Ann x n matrix that is filled with the numbers 1,2,3, ....n2 is a magic square if the sum of the elements in each row, in each column, and in the two main diagonals is the same value. For example, 16 3 213 5 10 11 8 9 6 7 12 4 15 14 1 Write the program that reads in 16 values from the keyboard and tests whether they form a magic square when put into a 4...

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