Question

How to multiply a matrix by a scalar values in MatLab? for example X = [234...

How to multiply a matrix by a scalar values in MatLab? for example X = [234 75 98 39; 91 186 101 116; 149 136 39 119; 95 175 126 39]. Multiply each row by a different scalar e.g 2, 3, 6, 4 respectively.

Homework Answers

Answer #1

This involves concepts of simple matrix multiplication, which is:

If we multiply a diagonal matrix with another matrix A, then the matrix A each row is multiplied by the element present in that row of the diagonal matrix. (Take some example and solve it yourself to observe the explanation.)

Here is the MATLAB code:

X = [234 75 98 39; 91 186 101 116; 149 136 39 119; 95 175 126 39]

Y = diag([2 3 6 4])*X % output -> diagonal matrix is created by the required scalars and multiplied by X

Output:

Y =

468 150 196 78
273 558 303 348
894 816 234 714
380 700 504 156

Know the answer?
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
Similar Questions
Refer to the accompanying data set of mean​ drive-through service times at dinner in seconds at...
Refer to the accompanying data set of mean​ drive-through service times at dinner in seconds at two fast-food restaurants. Construct a 95​% confidence interval estimate of the mean​ drive-through service time for Restaurant X at​ dinner; then do the same for Restaurant Y. Compare the results. Restaurant X Restaurant Y 85 85 116 116 118 118 146 146 270 270 100 100 124 124 156 156 118 118 176 176 184 184 125 125 154 154 166 166 211 211...
Refer to the accompanying data set of mean drive-through service times at dinner in seconds at...
Refer to the accompanying data set of mean drive-through service times at dinner in seconds at two fast food restaurants. Construct a 99% confidence interval estimate of the mean drive-through service time for restaurant X at dinner then do the same for restaurant Y Restaurant X Restaurant Y 83 101 119 131 116 155 143 111 263 174 178 135 122 111 154 123 166 128 215 128 328 131 303 136 179 230 109 217 154 296 149 126...
Open Three Hospitals data. SETUP: It is believed that the number of injuries recorded in hospital...
Open Three Hospitals data. SETUP: It is believed that the number of injuries recorded in hospital 1 is different from the number of injuries recorded in hospital 2. Given the data your job is to confirm or disprove this assertion. 10. What test/procedure did you perform? (4 points) a. Regression b. Two sided t-test c. One sided t-test d. Confidence Interval 11. What is the statistical interpretation? (4 points) a. Average of data is inconsistent with the claim b. P-value...
A loan made on March 14 is due September 13 of the following year. Find the...
A loan made on March 14 is due September 13 of the following year. Find the exact time for the loan in a​ non-leap year and a leap year. days. The exact time in a​ non-leap year is ? days The exact time in a leap year is ? days. Data Table Sequential Numbers for Dates of the Year Day of Month Jan. Feb. Mar. Apr. May June July Aug. Sept. Oct. Nov. Dec. 1 1 32 60 91 121...
Pat.# Before After 1 195 125 To the left is 2 datasets measured for a sample...
Pat.# Before After 1 195 125 To the left is 2 datasets measured for a sample of 107 patients with the high cholesterol level before and after taking medication. Obtain the following for both sets: 2 208 164 3 254 152 1- the mean, mode and median 4 226 144 5 290 212 2- the variance and standard deviation 6 239 171 7 216 164 3- First, second and third quartiles 8 286 200 9 243 190 10 217 130...
Many standard statistical methods that you will study in Part II of this book are intended...
Many standard statistical methods that you will study in Part II of this book are intended for use with distributions that are symmetric and have no outliers. These methods start with the mean and standard deviation, x and s. For example, standard methods would typically be used for the IQ and GPA data here data215.dat. (a) Find x and s for the IQ data. (Round your answers to two decimal places.) s= Here are the numbers obs gpa iq gender...
I am making a game like Rock Paper Scissors called fire water stick where the rules...
I am making a game like Rock Paper Scissors called fire water stick where the rules are Stick beats Water by floating on top of it Water beats Fire by putting it out Fire beats Stick by burning it The TODOS are as follows: TODO 1: Declare the instance variables of the class. Instance variables are private variables that keep the state of the game. The recommended instance variables are: 1. 2. 3. 4. 5. 6. A variable, “rand” that...
The Red Lobster Restaurant chain conducts regular surveys of its customers to monitor the performance of...
The Red Lobster Restaurant chain conducts regular surveys of its customers to monitor the performance of individual restaurants. One of the questions asks customers to rate the overall quality of their last visit. the listed responses are Poor 1, Fair 2, Good 3, Very Good 4, and Excellent 5. The survey also asks respondents whether their children accompanied them (1=yes) and (2=no). Graphically depict these data and describe your findings. Customer Rate Children 1 4 1 2 3 2 3...
Researchers in a 2015 study by Flannery et al. sought to estimate the effectiveness of the...
Researchers in a 2015 study by Flannery et al. sought to estimate the effectiveness of the seasonal influenza vaccine in preventing acute respiratory infection (ARI). A total of 507 subjects from Texas who showed symptoms of ARI were recruited for this study. The data provided show the result of each subject's test for influenza. Click to download the data in your preferred format.    CrunchIt!    CSV    Excel    JMP    Mac-Text    Minitab    PC-Text    R   ...
Use the Manufacturing database from “Excel Databases.xls” on Blackboard. Use Excel to develop a multiple regression...
Use the Manufacturing database from “Excel Databases.xls” on Blackboard. Use Excel to develop a multiple regression model to predict Cost of Materials by Number of Employees, New Capital Expenditures, Value Added by Manufacture, and End-of-Year Inventories. Locate the observed value that is in Industrial Group 12 and has 7 employees. Based on the model and the multiple regression output, what is the corresponding residual of this observation? Write your answer as a number, round to 2 decimal places. SIC Code...