# [Scilab-users] convert vector to list

4 messages
Open this post in threaded view
|

## [Scilab-users] convert vector to list

Dear All,

Is there a Scilab function to convert a vector to a list?

If x is a vector, this code

L = list();
for n=1:length(x)
L(n) = x(n);
end

seems to work, but it would be nice to have a primitive doing this more efficiently. I don't seem to be able to find it.

Regards,

Federico Miyara

 Libre de virus. www.avast.com

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

## Re: convert vector to list

vec2list() ?

Le 18/02/2021 à 19:34, Federico Miyara a écrit :

Dear All,

Is there a Scilab function to convert a vector to a list?

If x is a vector, this code

L = list();
for n=1:length(x)
L(n) = x(n);
end

seems to work, but it would be nice to have a primitive doing this more efficiently. I don't seem to be able to find it.

Regards,

Federico Miyara

 Libre de virus. www.avast.com

```_______________________________________________
users mailing list
[hidden email]
```
```--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet
```

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

## Re: convert vector to list

He he

Sometimes the answer is so 'obvious' ... it's just that the user never heard about it before. Myself included.

/Claus

On 18-02-2021 19:37, Stéphane Mottelet wrote:

vec2list() ?

Le 18/02/2021 à 19:34, Federico Miyara a écrit :

Dear All,

Is there a Scilab function to convert a vector to a list?

If x is a vector, this code

L = list();
for n=1:length(x)
L(n) = x(n);
end

seems to work, but it would be nice to have a primitive doing this more efficiently. I don't seem to be able to find it.

Regards,

Federico Miyara

 Libre de virus. www.avast.com

```_______________________________________________
users mailing list
[hidden email]
```
```--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet
```

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

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