[Scilab-users] create submatrix

Rafael Guerra jrafaelbguerra at hotmail.com
Wed Nov 15 09:51:13 CET 2017


Hi,

You can try this:
a = [1 2 3; 4 5 6]; 
ix = 1:size(a,2);
a(:,find(ix<>2))

Regards,
Rafael

-----Original Message-----
From: users [mailto:users-bounces at lists.scilab.org] On Behalf Of Hermes
Sent: Wednesday, November 15, 2017 9:43 AM
To: users at lists.scilab.org
Subject: [Scilab-users] create submatrix

Hola,
I have the following matrix
a = [1 2 3; 4 5 6]
and I want to select all columns except one.
I have achieved it in the following way.
a (:, [1 3]);
a (:, [2 3]);
a (:, [1 2]);

and in this other way:
b = [1 2 3]
a (:, [b (b ~ = 1)]);
a (:, [b (b ~ = 2)]);
a (:, [b (b ~ = 3)]);

But I would like to achieve it using a single index; something like that:
a (:, [column ~ = 2])
Any suggestions,

Gracias



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
users at lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



More information about the users mailing list