matrix problem Matrix dimensions must agree

hello I have the following problem:
Error using -
Matrix dimensions must agree.
Error in CMF_Cut (line 136)
pts = divp -(ps - pt + u /cc );
I tried to use ./ but the problem remains the same

9 Kommentare

madhan ravi
madhan ravi am 10 Mär. 2019
size(divp), size(ps), size(pt), size(u) & size(cc) ?
dakhli mohamed
dakhli mohamed am 10 Mär. 2019
Bearbeitet: per isakson am 10 Mär. 2019
size(divp)
ans =
652 4098
size(ps)
ans =
652 1366 3
size(pt)
ans =
652 1366 3
size(u)
ans =
652 1366 3
size(cc)
ans =
1 1
Walter Roberson
Walter Roberson am 10 Mär. 2019
Those arrays that are 652 x 1366 x 3 have the same number of elements as the array that is 652 x 4098, but they have different number of dimensions. How would you like to define the result of subtracting a 652 x 1366 x 3 array from a 652 x 4098 array ?
Perhaps?
pts = divp(:)-reshape(ps - pt + u /cc,[],1);
dakhli mohamed
dakhli mohamed am 10 Mär. 2019
I even tried with image size 285 * 285 and still the same type of error, but in the end I want to have an image of X * X
Walter Roberson
Walter Roberson am 10 Mär. 2019
What is X here? In the case where you had the mix of 652 x 4098, compared to 652 x 1366 x 3, then what output size are you looking for?
dakhli mohamed
dakhli mohamed am 10 Mär. 2019
I found that my algorithm works with X * X double and the errue is that my image is of the form X * X * 3 it is necessary now that I convert it in the form X * X
Walter Roberson
Walter Roberson am 10 Mär. 2019
Okay, so how do you want to do that conversion? For example do you want to extract the Saturation value of the HSV equivalent of an RGB image?
dakhli mohamed
dakhli mohamed am 10 Mär. 2019
Yes good idea

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte

Gefragt:

am 10 Mär. 2019

Bearbeitet:

am 10 Mär. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by