Can someone get the answer for me on this? Really appreciated
5 次查看(过去 30 天)
显示 更早的评论
The test suite generates a random M x N matrix with a random number of rows and columns that is assigned to the variable A . The element values of the matrix are random double precision numbers that fall in the range from -10 to 10. The matrix has between 5 and 10 rows and between 5 and 10 columns. Assuming A is defined in the workspace, write a script with commands to perform the operations described below and assign the results to the indicated variable names.
- Add a row to the bottom of A that consists of the mean of each column of A and assign the resulting matrix to B.
- Still starting with the original matrix A, add a row to the bottom of A that consists of the sum of each column of A and assign the resulting matrix to C.
- Next add a column to C that consists of the sum of each row of C and assign the resulting matrix to D.
2 个评论
Jan
2017-2-8
编辑:Jan
2017-2-8
This sound like a homework question. If we solve your homework, you cannot deliver it anymore without cheating.
These are very basic Matlab questions. Reading the "Getting Started" chapters of the documentation will help you to solve this by your own. It would not be useful to rephrase these chapters. Most likely this is not the last Matlab homework for you, therefore I think, you cannot avoid to read the manuals.
If you post, what you have tried so far and ask a specific question, it is very likely, that you get assistance.
采纳的回答
Image Analyst
2017-2-8
Hint - here's a start (just because I have a son in college undergoing the same thing so I know how it feels). You finish it:
columnMeans = mea....
B = [A; columnMeans];
columnSums = s.......
C = [A; .......
rowSums = sum(C,......
D = [C, rowSums......
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calendar 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!