How to select rows in a table containing both string and numbers?
Show older comments
Hi everyone,
I'm looking for a method to extract centain rows from a table. The table is loaded form an excel file carried out through the structural analysis software SAP2000. Here a screenshot of the table loaded in MATLAB:

I need to extract the values contained in the colums "Joint", "StepNum", "U1", "U2", "U3". In detail, i need to extract only the rows for the "StepNum" values 1, 2, 8, 9, 11. Furthermore, i'm interested to extract only rows for certain "Joint" values.
The "Joint" rows of interest are:
joints=["2440" "2841" "2989" "S-19" "S-37" "445" "829" "1181" "P-1" "P-3" "447" "831" "1183" "2435" "S-23" "S-41" "2840" "2988" "1476" "1768""2036" "P-2" "P-4" "1478" "1770" "2038" "2442" "S-27" "S-45" "2844" "2992"];
I need something like this:

I tried some struffs but to no avail. I think it is due to cells of the table: "Joints" column contains cells (joints are named using text); the other colums of interest ("StepNum", "U1", "U2", "U3") contains numbers.
Any help or input here would be appreciated!
Thanks in advance!
1 Comment
Daniele Giunta
on 7 Oct 2022
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!