필터 지우기
필터 지우기

How can I guarantee data is placed into the correct spot in a matrix?

조회 수: 2 (최근 30일)
Kurt
Kurt 2012년 11월 27일
I have data being placed into a 16x16 matrices from a loop and one piece is ending up in the wrong column despite the label. I have it designated as J(14,6) and despite all efforts I end up with the results in J(13,6).

채택된 답변

Kurt
Kurt 2012년 11월 27일
That does not help. I started with (1,1) for the matrices and all the rest of the data was placed correctly.

추가 답변 (2개)

Doug Hull
Doug Hull 2012년 11월 27일
MATLAB is ones based not zeros based. Does this change your question?

Babak
Babak 2012년 11월 27일
He (Doug) means tyhe indices in MATLAB start from 1 not 0. So you have J(1,1) as the first element and J(0,0) returns an error.
You need to use J(1:14,1:6) to access the first 14 rows and first 6 columns of J.

카테고리

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