number of a row in an array

number of a row in an array - HELP How do you get the number of a row, of a matrix? - Poruke

#1 Objavljeno: 26. 3. 2021. 23:40:35
Erick Valentino

Erick Valentino

7 svidjanja u 29 postova.

Grupa: User

Hi guys

Do you know how to get the number of a row in an array?
ie I have a 5 * 2 array, I want to know what is the number of a particular row

¿Cómo se obtiene el número de una fila, de una matriz?
How do you get the number of a row, of a matrix?
I do not speak English, I hope you can understand me with the following image

COL.png
#2 Objavljeno: 27. 3. 2021. 00:33:17
NDTM Amarasekera

NDTM Amarasekera

130 svidjanja u 352 postova.

Grupa: User

Hello Valentino!
This snippet downloaded from the forum long time back.
Credit to the author, but cannot remember.
There may be other short cuts too.

Cheers.....

Find_Row_Num.png
Look within!... The secret is inside you. Best Regards Eng. NDTM Amarasekera - Sri Lanka
2 korisnika je svidelo ovu objavu
Erick Valentino 6. 5. 2021. 07:32:00, Oscar Campo 10. 5. 2024. 19:12:00
#3 Objavljeno: 27. 3. 2021. 07:32:48
NDTM Amarasekera

NDTM Amarasekera

130 svidjanja u 352 postova.

Grupa: User

To find the indices of an array of values.
Cheers.....

Find_Row_Num.sm (95,29 KiB) preuzeto 1660 put(ova).

Find_Row_Num2.png
Look within!... The secret is inside you. Best Regards Eng. NDTM Amarasekera - Sri Lanka
3 korisnika je svidelo ovu objavu
sergio 27. 3. 2021. 08:42:00, Erick Valentino 6. 5. 2021. 07:32:00, Oscar Campo 10. 5. 2024. 19:12:00
#4 Objavljeno: 27. 3. 2021. 08:33:47
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

Do you know how to get the number of a row in an array?


These 4 are from a much larger compendium.
You will go a long route with them.
Jean

Utilities Matrix Truth Table [Locate row_col].sm (45,47 KiB) preuzeto 1412 put(ova).
Utilities Matrix Locate Array1 Array2.sm (70,25 KiB) preuzeto 1625 put(ova).
Utilities Matrix Truth Table [Locate row_col] COMPANION.sm (153,6 KiB) preuzeto 1520 put(ova).
Utilities Matrix Treasury_1.sm (423,07 KiB) preuzeto 1672 put(ova).
1 korisnika je svidelo ovu objavu
Erick Valentino 6. 5. 2021. 07:32:00
#5 Objavljeno: 6. 5. 2021. 07:35:13
Erick Valentino

Erick Valentino

7 svidjanja u 29 postova.

Grupa: User

Wrote

Hello Valentino!
This snippet downloaded from the forum long time back.
Credit to the author, but cannot remember.
There may be other short cuts too.

Cheers.....

Find_Row_Num.png



Thank you very much, it worked perfectly for me,
the method you teach is very useful.
Thanks for taking the time and sharing your ideas.
#6 Objavljeno: 6. 5. 2021. 08:21:02
Martin_B

Martin_B

22 svidjanja u 84 postova.

Grupa: User

Alternative (needs special functions plugin):

match.png

Or in one line:

match2.png
#7 Objavljeno: 6. 5. 2021. 09:49:36
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

Do you know how to get the number of a row in an array?
i.e: I have a 5 * 2 array, I want to know what is the number of a particular row



Array.PNG

#8 Objavljeno: 27. 7. 2023. 16:04:49
Beyaz

Beyaz

0 svidjanja u 19 postova.

Grupa: User

hey,

i have a some problem.
i hope someone can solve this problem too.

in the first exampe "match" its not working but in the second example it works. i dont know why

Unbenannt.PNG


#9 Objavljeno: 27. 7. 2023. 22:14:46
overlord

overlord

601 svidjanja u 1.382 postova.

Grupa: Moderator

Wrote

hey,

i have a some problem.
i hope someone can solve this problem too.

in the first exampe "match" its not working but in the second example it works. i dont know why


Hi Beyaz,
For first warning, row() expect a real pure number for second argument.
Your findrows() result is a number with N unit.

Due to your second problem;
I think commas in your subscripts makes the bug.
When they are deleted, your function match() works.

Regards

PS: Please provide your problematic file next time.
Rewriting your entire screenshot is cumbersome.

match.sm (10,75 KiB) preuzeto 1582 put(ova).

2023-07-28_04-06.png
#10 Objavljeno: 28. 7. 2023. 09:27:38
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

More utilities were designed and available.
These 4 will go a long route ... projects.
Created Studio, sanity checked Solver 30405.

Utilities Matrix Locate Array1 Array2.sm (70,46 KiB) preuzeto 1600 put(ova).
Utilities Matrix FindIndex DUAL COMPANION Copy.sm (108,1 KiB) preuzeto 1866 put(ova).
Utilities Matrix FindIndexKey COMPANION QUICK Copy.sm (89,52 KiB) preuzeto 1707 put(ova).
Utilities Matrix FindIndexKey COMPANION QUICK.sm (89,51 KiB) preuzeto 1649 put(ova).
#11 Objavljeno: 28. 7. 2023. 16:32:39
Beyaz

Beyaz

0 svidjanja u 19 postova.

Grupa: User

Wrote

Wrote

hey,

i have a some problem.
i hope someone can solve this problem too.

in the first exampe "match" its not working but in the second example it works. i dont know why


Hi Beyaz,
For first warning, row() expect a real pure number for second argument.
Your findrows() result is a number with N unit.

Due to your second problem;
I think commas in your subscripts makes the bug.
When they are deleted, your function match() works.

Regards

PS: Please provide your problematic file next time.
Rewriting your entire screenshot is cumbersome.

match.sm (10,75 KiB) preuzeto 1582 put(ova).

2023-07-28_04-06.png





thanks overlord
sorry, you are right, next time i will add the file.

i tried it but it doesnt work. this time i add the file.
vogt.sm (636,54 KiB) preuzeto 1735 put(ova).


//I solved it like this
122.PNG
#12 Objavljeno: 28. 7. 2023. 17:03:03
overlord

overlord

601 svidjanja u 1.382 postova.

Grupa: Moderator

Your while loop shouldn't produce E.rkx.
At least my computer doesn't.
There should be an E.rkx output at end of it.

I would solve eval() problem like this.

Regards

2023-07-28_23-01.png
#13 Objavljeno: 29. 7. 2023. 08:22:05
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Attach an image of a typical 6 x 4 matrix 4 decimals.
From there, say what you want to extract.
That will ease the guidance, while avoiding confusion.
#14 Objavljeno: 5. 1. 2024. 16:37:40
Beyaz

Beyaz

0 svidjanja u 19 postova.

Grupa: User

hey guys,

Your suggestions were very helpful, but is it possible to rewrite the function so that strings are also can be match.
Im looking for the Index of "b" ->[2]

KLED.sm (4,45 KiB) preuzeto 1672 put(ova).
Screenshot 2024-01-05 093421.png
#15 Objavljeno: 6. 1. 2024. 03:48:08
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: Moderator

The result of findrows() is a matrix, even if there is only one match (exept for no matches, then the result is the number zero)
Converting it to a scalar, seems to help. The same could be applied to the overall result to remove the matrix.

Yet, there is a shorter way to get the index. This, however, won't work for multiple matches.

Fajl nije pronađen.Fajl nije pronađen.
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
  • Novi postovi
  • Nema novih postova