[Scilab-users] create submatrix

jasper van baten jasper at amsterchem.com
Wed Nov 15 09:47:21 CET 2017


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
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20171115/52c8ed4b/attachment.htm>


More information about the users mailing list