Hey ppl,

I have a matlab function which calls on another function like so:

-------------------------------------------------------------------------

Function 1:

function E = solve_it(m,t,i)

%where m is a 2 column matrix with 1 or more rows(amount is of the users choosing)

r=m(:,1);

s=m(:,2);

A=r./s;

invE=A+1/t+1/i;

E=1/invE;

-------------------------------------------------------------------------

Function 2:

function B = solve_them(m,f,g,t,i,t1,t2)

E=solve_it(m,t,i);

B=E*f*g*(t1-t2);

-------------------------------------------------------------------------

For the following inputs into B i get the correct answers:

>> B = solve_them([2 4],4,5,2,3,7,2)

B =

75

>> B = solve_them([3 5],4,5,2,3,7,2)

B =

69.7674

------------------------------------------------------------------------

Yet putting in both as 1 matrix i get 1 correct and 1 always at 0

>> B = solve_them([2 4;3 5],4,5,2,3,7,2)

B =

0 69.7674

When the output i would desire is

75

69.7674

-------------------------------------------------------------------------

Can anyone identify what im doing wrong, im guessing its something to do with me using the m(:,1) and m(:,2) selections.