[Scilab-users] create submatrix
Heinz Nabielek
heinznabielek at me.com
Thu Nov 16 13:41:18 CET 2017
Ingenious: I had the problem months ago and used a much more clumsy solution....
Heinz
On 15.11.2017, at 12:05, Osvaldo Sergio Farhat de Carvalho wrote:
> Try this:
>
> -->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" <users-bounces at lists.scilab.org> escreveu: -----
> Para: users at lists.scilab.org
> 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
>> scilab.org/mailman/listinfo/users
More information about the users
mailing list