MATLAB: If conditions for values of table

if conditiontable

Hi everyone,
I'm trying to solve following problem for a table with two columns (x,y) and a changing amount of rows (about 100). I would like to calculate atand(y./x) for abs(x)>abs(y) and atand(x./y) for abs(x)<abs(y). Can anybody help me out with a code for that? Thank you very much!!

Best Answer

x = t.x;
y = t.y;
mask = abs(x) < abs(y);
degree(mask) = atand(x(mask)./y(mask));
degree(~mask) = atand(y(mask)./x(mask));
t.degree = degree;
I wonder if you would prefer atan2d ?