Through help from users on this site I have come to the following to remove columns from matrix:
a = [5 1 4; 2 1 1; 5 2 8];
n = size(a,1)
for i=1:n,
[v, i] = min(a(3,:));
col = a(:, i);
a(:, i) = [];
end
I am looking to combine the col for each of the iterations to one matrix.
Any suggestions?
I’m not quite sure if I understand the question. Do you want this:
The result would look like: