Selecting an entry of a row in a large matrix

조회 수: 5 (최근 30일)
amberly hadden
amberly hadden 2015년 7월 31일
댓글: amberly hadden 2015년 7월 31일
Can any one help me with this ?
I want to select each 3rd row and first entry of it and want to output all values in a matrix. Next I want to remove this out put vector from original matrix a =
64 2 3 61 60 6 7 57
9 55 54 12 13 51 50 16
17 47 46 20 21 43 42 24
40 26 27 37 36 30 31 33
32 34 35 29 28 38 39 25
41 23 22 44 45 19 18 48
49 15 14 52 53 11 10 56
8 58 59 5 4 62 63 1
ans
b =[17 41];% this is what I need in first step
and then final matrix with removing every 3rd row (which omits the every third row)
Thanks, Amb

채택된 답변

amberly hadden
amberly hadden 2015년 7월 31일
out = a(3:3:end,:)
this worked but now I just wanna remove these rows from original matrix

추가 답변 (1개)

James Tursa
James Tursa 2015년 7월 31일
b = a(3:3:end,1); % 1st element of every 3rd row
a(3:3:end,:) = []; % remove every 3rd row

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by