MATLAB: Help with ordering tables


dear colleages… i have a problem with a table… here is the problem….
i got a table named depth:
i need to create two new tables (submarine and aerea) each one composed by selected values of the table depth and also composed by two columns each one:
for submarine: i need all negative values of the second column of depth (depth(:,2), with each corresponding value of the first colum of depth (depth(:,1).
for aerea: the same but positve values…
i prepare this but dosent work
i think, find is not correct to be used in this case…. but what can i use?

Best Answer

  • submarine = depth(depth(:,2)<0, :);
    aerea = depth(depth:,2)>0, :);
    Question: what if the depth was exactly 0 ?