Help solving this msg: "In an assignment A(I) = B, the number of elements in B and I must be the same" according to my code bellow.

%Mensurements of the Agrorobot
Pc(1) = [2;4;2;1];
Pc(2) = [3;3;5;1];
Pc(3) = [4;1;2;1];
Pc(4) = [7;8;1;1];
Pc(5) = [5;4;2;1];
Pc(6) = [1;8;7;1];
Pc(7) = [3;2;0;1];
Pc(8) = [9;8;1;1];
Pc(9) = [1;4;7;1];
Pc(10) = [2;1;5;1];
%Homogenius Matrix * Pm
Pm(1) = [1;1;3;1];
Pm(2) = [6;2;4;1];
Pm(3) = [4;4;3;1];
Pm(4) = [9;1;0;1];
Pm(5) = [2;1;9;1];
Pm(6) = [1;3;7;1];
Pm(7) = [4;2;6;1];
Pm(8) = [1;5;6;1];
Pm(9) = [3;2;3;1];
Pm(10) = [4;2;1;1];
%finding all the combinations possibles of 4 vectors
for i = 1:10
for j = 1:10
for k = 1:10
for l = 1:10
PC = [Pc(i) Pc(j) Pc(k) Pc(l)];
PM = [Pm(i) Pm(j) Pm(k) Pm(l)];
HC = PC\PM % Homogenius matrix of the Camera
end
end
end
end

Answers (1)

It's impossible to assign a vector to a scalar variable. E.g. Pc(1) is a scalar, [2;4;2;1] is a vector.
Best wishes
Torsten.

This question is closed.

Products

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!