필터 지우기
필터 지우기

HOW can i create a matrix of pixels positions? (x,y) coordinates

조회 수: 2 (최근 30일)
bay rem
bay rem 2015년 12월 12일
댓글: bay rem 2015년 12월 13일
i wanna create 3*3 matrix describes pixels positions i defined m as 3*3: m=zeros(3) and then i simply filled the matrix with x,y coordinates but here the matrix's size became 3*6 ...i really need help please

채택된 답변

Walter Roberson
Walter Roberson 2015년 12월 12일
3 x 3 = 9, which is an odd number. Pairs of x and y positions take two items per pair, which is even. You cannot store an whole number of even values in an odd number of slots without having a slot left over.
Perhaps you want
m = cell(3,3);
and then store (for example)
m{2,3} = [x,y];
This would result in a 3 x 3 cell array, each member of which holds two values. This would not be a numeric array.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by