How to get specific data from specified rows and variables in a table?

1 次查看(过去 30 天)
I have created this table
Sensor_type=["COB4_St1";"COB4_St2";"COB4_St3";"COB4_St4";"COB4_St5";"COB4_St6";"NOB4_St1";"NOB4_St2";"NOB4_St3";"NOB4_St4";"NOB4_St5";"NOB4_St6";"NO2B43F_St1";"NO2B43F_St2";"NO2B43F_St3";"NO2B43F_St4";"NO2B43F_St5";"NO2B43F_St6";"OXB431_St1";"OXB431_St2";"OXB431_St3";"OXB431_St4";"OXB431_St5";"OXB431_St6"]; Sensitivity=[0.437;0.437;0.483;0.429;0.438;0.398;0.509;0.550;0.492;0.520;0.579;0.614;0.321;0.353;0.330;0.360;0.356;0.358;0.325;0.346;0.346;0.377;0.358;0.372]; Electronic_Zero_WE=[0.360;0.357;0.357;0.355;0.357;0.351;0.296;0.295;0.295;0.295;0.287;0.279;0.230;0.216;0.225;0.230;0.219;0.232;0.235;0.216;0.239;0.221;0.234;0.215]; Electronic_zero_AUX=[0.354;0.351;0.356;0.348;0.338;0.362;0.286;0.291;0.287;0.292;0.289;0.288;0.219;0.226;0.225;0.231;0.224;0.232;0.231;0.235;0.220;0.231;0.230;0.213];
Table= table(Sensor_type,Sensitivity,Electronic_Zero_WE,Electronic_zero_AUX);
I need to get the sensitivity of COB4_St1 and use it in the fuction.
S = A - sensitivity of COB4.
How can I write this on Matlab.
Thank you!

采纳的回答

Ridwan Alam
Ridwan Alam 2019-12-12
编辑:Ridwan Alam 2019-12-12
S = A - Table.Sensitivity(Table.Sensor_type=="COB4_St1")

更多回答(1 个)

Bhaskar R
Bhaskar R 2019-12-12
S = A -table2array(Table(1, 2)); % where Table(1, 2) indicates 1 row second column i.e Sensitivity values of "COB4_St1"
For more info of table indexing read

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by