[Scilab-users] create submatrix

classic Classic list List threaded Threaded
8 messages Options
Hermes Hermes
Reply | Threaded
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
jasper van baten jasper van baten
Reply | Threaded
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
Rafael Guerra Rafael Guerra
Reply | Threaded
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
Osvaldo Carvalho Osvaldo Carvalho
Reply | Threaded
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 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
[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
jean-philippe grivet jean-philippe grivet
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Radon transform

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
Tan Chin Luh-2 Tan Chin Luh-2
Reply | Threaded
Open this post in threaded view
|

Re: Radon transform

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
Christophe Dang Ngoc Chan Christophe Dang Ngoc Chan
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} Re: create submatrix

In reply to this post by Osvaldo Carvalho
Hello,

> 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.

Another possibility :

--> a = [1 2 3; 4 5 6]
 a  =

   1.   2.   3.
   4.   5.   6.


--> foo = a
 foo  =

   1.   2.   3.
   4.   5.   6.


--> foo(:, 2) = []
 foo  =

   1.   3.
   4.   6.

HTH, regards

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Heinz Nabielek-3 Heinz Nabielek-3
Reply | Threaded
Open this post in threaded view
|

Re: create submatrix

In reply to this post by Osvaldo Carvalho
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" <[hidden email]> escreveu: -----
> Para: [hidden email]
> 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

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users