combining arrays

combining arrays - Messages

#1 Posted: 1/11/2022 11:21:07 AM
1986max

1986max

0 likes in 9 posts.

Group: User

Tell me please.

Question - 1

There are several arrays. a=[1;2...4], b=[7;8..10], c=[12;13...15]

How do I combine them so that it turns out as follows - d=[1,2,3,4,7,8,9,10,12,13,14,15]

Question - 2

There is an array a=[1;2...10], I need to exclude several values from it so that it turns out as follows a=[1,2,5,6,7,9,10]

q-1-2.sm (3 KiB) downloaded 22 time(s).
#2 Posted: 1/11/2022 1:12:55 PM
sergio

sergio

115 likes in 329 posts.

Group: User

One way (stack use)

q-1-2_ser.sm (6 KiB) downloaded 45 time(s).
sergio
1 users liked this post
Andrey Ivashov 1/11/2022 3:23:00 PM
#3 Posted: 1/11/2022 1:51:29 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Question - 2


Make it algo style, add/remove cols.
This way you will have in-situ as desired.
Welcome to Smath Community ... Jean.

AlgoSelect.PNG
#4 Posted: 1/12/2022 3:58:49 AM
1986max

1986max

0 likes in 9 posts.

Group: User

thank a lot, all options are excellent!)
#5 Posted: 1/12/2022 10:26:33 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Thank a lot, all options are excellent !


Appreciated ... more in there ... Jean.

Utilities Matrix Extractors.sm (56 KiB) downloaded 31 time(s).
1 users liked this post
sergio 1/12/2022 11:17:00 AM
#6 Posted: 1/14/2022 3:06:20 PM
overlord

overlord

551 likes in 1332 posts.

Group: Moderator

In addition to sergio's answer, you can use an custom exclude function.
It will remove substances of a L# list from master M# list.

Regards

exclude.sm (5 KiB) downloaded 29 time(s).

2022-01-14_21-02.png
  • New Posts New Posts
  • No New Posts No New Posts