retrive specific column value from a matrix

1 Ansicht (letzte 30 Tage)
Mohammad Golam Kibria
Mohammad Golam Kibria am 13 Jun. 2011
Hi,
suppose I have a matrix I as follows:
I =
1 2 5 1 8 1 8
1 2 8 8 8 1 1
1 2 1 1 1 1 1
1 2 5 2 1 1 1
1 1 1 1 1 5 1
1 1 1 1 1 1 1
I need the value of column 4 and 5 where column 2 have value value 2
can any one help?

Akzeptierte Antwort

Jan
Jan am 13 Jun. 2011
R = I(I(:, 2) == 2, 4:5)

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by