How can I solve matrix selection extraction
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, I am a college student studying MATLAB.
I want to select columns 1-101, columns 103-203, 205-305, and columns 307-407 among the attached 309×816 matrices and make them into one matrix.
How can i solve it. Please let me know.
thank you
답변 (3개)
Chunru
2022년 6월 28일
load C.mat
% select columns 1-101, columns 103-203, 205-305, and columns 307-407
% and make them into one matrix.
WhatYouWant = C(:, [1:101 103:203 205:305 307:407]);
% The : means all rows; [....] means the selected columns
whos
댓글 수: 0
AMIT POTE
2022년 6월 28일
You can go through the following documentation to understand indexing in MATLAB
댓글 수: 0
Neeraj Mirji
2022년 6월 28일
The following code extracts the mentioned columns into newMatrix.
newMatrix = C(: , [1:101 103:203 205:305 307:407]);
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!