If I have a matrix of data and I want to pull out certain data cells and arrange them in another matrix?

1 view (last 30 days)
More info:
I have a matrix of information and I want to pull certain data cells from all the rows beginning with a 20.
Of the rows starting with the number 20, I want the third cell over.
Ex. I want to grab the cells that are bolded.
10 40 50 80
20 40 20 34
30 50 32 50
20 38 40 36
I want to then take those data cells and put them into a 1 lined matrix

Accepted Answer

Thomas
Thomas on 28 Jun 2012
a=[10 40 50 80
20 40 20 34
30 50 32 50
20 38 40 36]
c=find(a(:,1)==20)
out= a(c,3)

More Answers (0)

Categories

Find more on Data Types in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!