Matrix Manipulations 1 (extracting elements for new matrices) E
조회 수: 82 (최근 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.
- Create a new 2 x N matrix, B, that consists of the first and last rows of A.
- Create a new 2 x 2 matrix, C, that consists of the elements at the four corners of A.
- Create a new M-1 x N-1 matrix, D, that consists of the second through last columns in the second through last rows of A.
답변 (1개)
Sanket Karnik
2017년 2월 15일
I understand that you need help in indexing into a matrix. Please refer to the following link: https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html
This article explains about how to index into a Matrix. The article also has many examples which will help you in understanding different types of indexing, which you can use to solve the question.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!