필터 지우기
필터 지우기

how to access individual values form a matrix

조회 수: 1 (최근 30일)
PK
PK 2012년 9월 27일
hello all in my proj am confused how to access each element in a matrix one after the other continuously in a large data for ex A=[1 2 3 4 5] is a matrix so first i want to take 1 next 2 and 3 and 4 and so on for some 1000 values so can some one suggest a path to do this

채택된 답변

Wayne King
Wayne King 2012년 9월 27일
You just access them by their index
A(1), A(2), etc
If the matrix is MxN, the linear indices are columnwise, in other words
A = rand(5,5);
A(1:5) % gives you the first column
A(6:10) % gives you the second

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by