# [Scilab-users] create submatrix

8 messages
Open this post in threaded view
|

## [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 [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

## Re: 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 [hidden email] http://lists.scilab.org/mailman/listinfo/users ``` _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

## Re: create submatrix

 In reply to this post by Hermes 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:[hidden email]] On Behalf Of Hermes Sent: Wednesday, November 15, 2017 9:43 AM To: [hidden email] 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 [hidden email] http://lists.scilab.org/mailman/listinfo/users_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

## Re: create submatrix

 In reply to this post by Hermes 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" <[hidden email]> escreveu: -----Para: [hidden email]De: jasper van baten Enviado por: "users" Data: 15/11/2017 07:08 AMAssunto: 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 matrixa = [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[hidden email]http://lists.scilab.org/mailman/listinfo/users _______________________________________________users mailing list[hidden email]http://lists.scilab.org/mailman/listinfo/users _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

 Hello, Does an implementation of the Radon transform exist in Scilab, similar to the Matlab "radon" function ? Would anybody be willing to share a homemade version ? Thank you for your input JP Grivet --- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

 Hi, If you are using the Scilab 6, you can consider using IPCV "imradon" function. another implementation in scilab code attached in this email, radon.sci. This is pretty slow as it is using a for loop if you were to plot from 0:179 degree.  this function will need nan toolbox. hope this helps. rgds, CL On 15/11/2017 8:01 PM, Jean-Philippe Grivet wrote: > Hello, > > Does an implementation of the Radon transform exist in Scilab, similar > to the Matlab > "radon" function ? Would anybody be willing to share a homemade version ? > > Thank you for your input > JP Grivet > > > --- > L'absence de virus dans ce courrier électronique a été vérifiée par le > logiciel antivirus Avast. > https://www.avast.com/antivirus> > _______________________________________________ > users mailing list > [hidden email] > http://lists.scilab.org/mailman/listinfo/users> _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users radon.sci (867 bytes) Download Attachment