vendredi 5 octobre 2018

How to add values to last column of a table based on certain conditions in MATLAB?

I have a 29736 x 6 table, hence referred to as table_fault_test_data. It has 6 columns, with names wind_direction, wind_speed, air_temperature, air_pressure, density_hubheight and Fault_Condition respectively. What I want to do is to label the data in the Fault_Condition (last table column with either a 1 or a 0 value, depending on the values in the other columns.

I would like to do the following checks (For eg.) 1. If wind_direction value is below 0.0040 and above 359.9940, label 6 th column entry corresponding to the respective row of the table as a 1, else label as 0. Do this for the entire table. Similarly, do this check for others like air_temperature, air_pressure and so on. I know that if-else will be used for these checks. But, I am really confused as to how I can do this for the whole table and add the corresponding value to the 6 th column (Maybe using a loop or something). Any help in this regard would be highly appreciated. Many Thanks!

Aucun commentaire:

Enregistrer un commentaire