필터 지우기
필터 지우기

Assign 3-by-1 matrix to image 3D matrix

조회 수: 2 (최근 30일)
Grega Mocnik
Grega Mocnik 2019년 9월 17일
답변: Grega Mocnik 2019년 9월 17일
Hello,
I get color values from loop and impixel function.
Color values is 1x3 matrix.
For my calculate must be color dimension like 3x1, therefoe transponing. Result is 3x1 matrix (LMS).
My question is:
how assign 3x1 (LMS) matrix to new matrix (A_LMS) which will be built (and dimension increase) simultaneously. New matrix (A_LMS) is the same size of original image (A)?
for Z = 1 : Za
for Y = 1 : Ya
for X = 1 : Xa
color = impixel(A, X, Y);
LMS = mapM*(color.');
A_LMS(, , Z) = LMS.';
end
end
end

채택된 답변

Grega Mocnik
Grega Mocnik 2019년 9월 17일
I solve this issue:
for Z = 1 : Za
for Y = 1 : Ya
for X = 1 : Xa
color = impixel(A, X, Y);
LMS = mapM*(color.');
[Xlms, Ylms] = size(LMS);
for Y_LMS = 1 : Ylms
for X_LMS = 1 : Xlms
A_LMS(X, Y, Z) = LMS(X_LMS, Y_LMS);
end
end
end
end
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by