From: ImageAnalyst on
Can you tell me what this
-(x * X(1,1) + X(3,1)) / X(2,1);
represents?
It's like you're taking some kind of strange weighted average of the
first and third X, and then dividing by the third X value. What
exactly is this? It's not a clipping or an interpolation.
From: Jim on
It is basically a form of the equation of a plane A = alpha*B+beta*C+mu, where we solve for C. For purposes of my application I let mu = 0 thus irrelevant.

So essentially,
C = (A- alpha*B)/beta

jimmy
From: Jim on
Hi guys,

I am under some stress with my supervisor and need some urgent help before Monday.
I am basically pleading for some small help.

jimmy
From: Walter Roberson on
Jim wrote:

> I am under some stress with my supervisor and need some urgent help
> before Monday.
> I am basically pleading for some small help.

Your requirements have changed since you have first posted and you have
improved your original code since then. Please post what you have _now_
and explain what you need to do differently from what you have now.
From: Jim on
ImageAnalyst helped me a bit .With his code it passes values as follows:

Using X column 1, VAL column 1
Using X column 2, VAL column 1
Using X column 1, VAL column 2
Using X column 2, VAL column 2
..
..
..

However, I need it to pass as follows:
Using X column 1, VAL(1,1)
Using X column 2, VAL(2,1)
Using X column 1, VAL(1,2)
Using X column 2, VAL(2,2)
Using X column 1, VAL(1,3)
Using X column 2, VAL(2,3)
Using X column 1, VAL(1,4)
Using X column 2, VAL(2,4)
..
..

This is my latest code:

%======================================
function returnValue = myfunc_answer2(maxOrMins, X)
returnValue = -(maxOrMins .* X(1) + X(3)) / X(2);
%======================================


%============================================
X = [34 87;...
59 79;...
45 22]

VAL = [2 5 6 11;...
8 7 9 15 ]


% Now loop through doing all columns of VAL and X
for vColumn = 1 : size(VAL, 2)
for xColumn = 1 : size(X, 2)

if (xColumn >1)
n=2;
else
n=1;
end


fprintf(1, 'Using X column %d, n %d,VAL column %d\n',...
xColumn, vColumn);
returnValue1 = myfunc_answer2(VAL(n , vColumn), X(:, xColumn))
end
end
%==================================================

thanks
jim