Find value in one row that corresponds to value within another row in the same table column

7 次查看(过去 30 天)
Hi,
I have a table with 2 rows and 4 columns
I want to find the value in row 2 that corresponds to the value e.g. '3' in row 1 in the same column
Thanks a bunch

采纳的回答

Cris LaPierre
Cris LaPierre 2023-3-23
T = table([1;2],[2;4],[3;6],[4;8])
T = 2×4 table
Var1 Var2 Var3 Var4 ____ ____ ____ ____ 1 2 3 4 2 4 6 8
T(2,T{1,:}==3)
ans = table
Var3 ____ 6

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Tables 的更多信息

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by