-->a = [1 2 3; 4 5 6]
a =
1. 2. 3.
4. 5. 6.
-->b = 1:3
b =
1. 2. 3.
-->a(:,b~=2)
ans =
1. 3.
4. 6.
-----"users" <[email protected]> escreveu: -----
Para: [email protected]
De: jasper van baten
Enviado por: "users"
Data: 15/11/2017 07:08 AM
Assunto: Re: [Scilab-users] create submatrix
n=size(a,2)
for i=1:n
b=a(:,[1:(i-1) (i+1):n])
end
De: jasper van baten
Enviado por: "users"
Data: 15/11/2017 07:08 AM
Assunto: Re: [Scilab-users] create submatrix
n=size(a,2)
for i=1:n
b=a(:,[1:(i-1) (i+1):n])
end
On 11/15/2017 9:42, Hermes wrote:
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
[email protected]
http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.scilab.org/mailman/listinfo/users
