I have a column in my table containing numerical data, where I want to make them into 4 specific groups in a new column in the same table. I do not know how to write the code, but have attempted the following failed codes. Please correct me.
num_rows = size(Table1.Time,1) %count the number of rows in Table 1
for i=1:1:num_rowsif T1.Time < 5 T1.TimeNew = 5; % Group 1, return in a new column in Table 1
elseif T1.Time >= 5 & T1.Time <15 T1.TimeNew = 15; % Group 2
elseif T1.Time >= 15 & T1.Time <25 T1.TimeNew = 25; % Group 3
else T1.TimeNew = 30; % Group 4 (for any data >=25)
endend
Best Answer