## Please write the code for this question.

Gaurav Srivastava

### Gaurav Srivastava (view profile)

님이 질문을 제출함. 4 Jun 2019
최근 활동 Alex Mcaulley

### Alex Mcaulley (view profile)

님이 답변함. 4 Jun 2019
Manali Gupta

### Manali Gupta (view profile)

님이 답변을 채택함.
Given a Matrix A,
• Create a row vector of 1's that has same number of elements as A has rows.
• Create a column vector of 1's that has the same number of elements as A has columns.
• Using matrix multiplication, assign the product of the row vector, the matrix A, and the column vector (in this order) to the variable result.
• A = [1:5; 6:10; 11:15; 16:20];

Alex Mcaulley

on 4 Jun 2019

로그인 to comment.

R2017b

## 답변 수: 2

### Manali Gupta (view profile)

on 4 Jun 2019

R_vector = ones(1,size(A,1));
C_vector=ones(size(A,2),1);
result = R_vector*A*C_vector;

로그인 to comment.

### Alex Mcaulley (view profile)

on 4 Jun 2019

I think the goal of this forum is not to do anyone's homework, but to solve generic questions about Matlab that can help more users. This exercise is very simple, anyone who has ever used Matlab could do it, so, I think the best thing we can do is help @Gaurav to know how to learn the basics of Matlab.

로그인 to comment.

Translated by