🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Search in matrix

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

Hi,

 

I would be grateful for some help for beginner user :

 

I have a matrix :


m1 = [ 1, 2, 3;
4, 5, 6;
7, 8, 9]; // A 3 by 3 matrix

And I would like to seek a specific number (6) and get values from row where '6' exists ?

Is in hypermath a dedicated function for searching inside the matrix ? or how to do it different ?

 

 

Thanks in advance 

 

 

 

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "tinh"
    Altair Community Member
    Updated by tinh

    Hi,

    I actually do not ever use hypermath. just see no answer for long time

    i found in help of hypermath (you can read more by open help>Hyperworks help home> Hypermath

     

    index a matrix by matrix_name(row,col)

    so search for a specific number in matrix by two loops

    for i = 0 to row 

    for j=i to col

     

    another way is convert a matrix to a tcl list and do searching by lsearch

    please look for how to convert hypermath to tcl in help of hypermath

    and also you need some knowledge about tcl list. access tcl global page for manuals