x = [1 2 3 ; 5 6 7 ; 9 12 17]
y = [1 5 8]'
XY = [x y]
XY(2,:) = XY(2,:) - 5 * XY(1,:)
XY(3,:) = XY(3,:) - 9 * XY(1,:)
XY(1,:) = 2 * XY(1,:) + XY(2,:)
XY(2,:) = 1/2 * XY(2,:)
XY(3,:) = -3 * XY(2,:) + XY(3,:)
XY(2,:) = 2 * XY(3,:) + XY(2,:)
XY(1,:) = XY(1,:) + XY(3,:)
How can i multiply last version of this matrix's all rows by 1/2? Is there any built-in ones to perform this in MATLAB
Solution:
Use bsxfun to multiply all rows by 0.5 for last version of matrix. Add this line to last of code
XY(:,:) = bsxfun(@times, XY, [0.5; 0.5; 0.5])
Explanation:
Syntax: X=bsxfun(fun, A, B)
Description: The function applies the element-wise binary operation specified by the function handle fun to arrays A and B.
fun implies Binary function to apply where times represents Array multiplication
X 3 5 7 5 6 7 9 4 8 6 Y 6 9 12 10 14 12 14 8 15 10 Discuss the relation between X and Y using an appropriate method. If possible, try to find the relation between X and Y treating X as independent variable?
Consider the following data: x : -7, -5, -1, 0, 2, 5, 6, .y: 15, 12 ,5, 2, 0, -5, -9. Using linear regression find the equation in the form y=mx+b. b) Check your results for the coefficients in the trial function using a built-in function in Matlab, Python, or Mathematica. c) Plot the data points as dots and the best-fit line as a solid line on the same figure.
***(unable to provide data except by using pictures) .2 6 9 3 8 3 2 1 5 5 4 9 9 9 4 5 7 5 4 7 82445538955922245 5 3 4 3 2 5 3 2 4 3 2 2 4 3 2 3 2 2 2 1 2 2 4 2 2 2 1 3 3 3 12 233 7 8 2 8 3 1 12111 2-21 1 382015785685 7 599231958 0 2 2 5 782 2990957503 1...
Solve in MATLAB Problem 3: Given the vector x- [2 1 0 6 2 3 5 3 4 1 3 2 10 12 4 2 7 9 2 4 51 use a for loop to (a) Add up the values of all elements in x (b) Compute the cumulative sum, y, of elements in x You can check your results using the built-in functions sum and cumsum. Q.5 What is the value of the sum of elements in vector x?...
x y 1 5.92 2 9.44 3 11.36 4 14.08 5 17 6 15.92 7 17.74 8 22.56 9 23.88 10 25.3 11 27.32 12 28.04 13 32.76 14 34.28 based on the data shown, calculate the regression line (each value to two decimal places) y= __________x + _______
(Information theory) Find uncertainties H(X), H(Y) and mutual information I(X;Y) X 3/10 1/2 1/5 2 9/20 1/8 17/40 X 3/10 1/2 1/5 2 9/20 1/8 17/40
WHICH equation describes the relationship between X and Y as in the table below x y 3 5 4 9 5 13 6 17a. y=4x-7,b.y=x+12,c.y=2x-5,d.y=3x-5can you give me the answer and explane it for me please!!!!!!!!!!!!
Part S: Compate fer each set of fractions 2 4 6 1 8+12- 2+7- 3 5 7 10-5-1 4 2 3 1 9 3 10 5- 7 2 3 3 5 3- 8 5- Part 6: Add and subtract the signed numbers. 8+18-(-3) -5-(-17) 42+ (-4) -12-(+26) 3+(-29)+ (-11) 0-(-16) +7 15-4+(-18) -54 +34 8+((41-(-17) -17-(-3+-1) 5-(16+-2) -33+(-5-6) Part 7: Multiply and divide the signed numbers (-4X-5)(20) (-2)(-7)-4) 13(-3)X2) 12+-3 -26/-13 (3(4X-1) -35+5 -84/-2 (11-3)3 6/3-2 (4 8)-1 (-30/10) -7
Function f is graphed. y 9 8 7 6+ y = f(x) CT 4+ 3+ 2+ 1+ H4+ 29-8-7 -6 -5 -4 3-2 1 2 3 4 5 6 7 8 9 -2 -3 4 -50 1 A 2+ M من 4 -58 -6 -8 -9 What appears to be the value of lim f(x)? 20+ 07 0-5 Unbounded Function g is graphed. → see y= g(2) 9 8 7+ 6+ 5+ 4+ es 2+ 1+ A+++ -9 -8 -7...
Job Seeker (k) 1 2 3 4 5 5 6 7 8 9 10 11 12 13 14 15 Interviews (Xi) 3 5 114 6 7 6 3 Job Offers (Y) 0 2 1 2 2 4. 3 5 1 4 6 100 7 4 8 1 1 8 4 2 (1) (2 points) Your friend Paul, who took Econ 140A last year, says that you should run a hypothesis test to evaluate Cathy's statement. If the null hypothesis is...