Thank you for all your assistance throughout this process Bill. So here is an explicit rundown of what I am after. Starting with the idea, I am trying to develop a module which will take input matrices which will represent the red, green, and blue channels of a digital image. This module will evaluate each pixel, or element, and do several calculations to convert each pixel into an hue, saturation, and intensity value. The last two operations, saturation and intensity, have been figured out, but I will explain what they are doing since it may help with the hue problem.
So we begin with a cube of equal length one, inside of which all red, green, and blue pixel values will lie, these are denoted by r,g,b=R,G,B/255. Once these values are obtained they are used to calculate the intensity. Going back to the cube, the line of intensity runs from 0,0,0 to 1,1,1 inside the cube, so intensity is the average of the three channels. Once along this intensity line we can form a plane triangle which has each of its vertices at {(0,0,1) (0,1,0) (1,0,0)}. To find where those r,g,b values lie on this triangle we convert them into r1,g1,b1 by taking the average of the normalized values which is done by r1,g1,b1=r,g,b/(r+g+b). Once these values are obtained we can use them to find the saturation and hue of each pixel/element in the matrix.
Saturation can be thought of as a vector emanating from the line of intensity in the center of the plane triangle. For saturation I created a composite matrix to represent a real image, where each element is a triplet of r1,g1,b1. Saturation is based off the lowest valued pixel of the three which is done using the Min[] function, these values are between (0,1) and are returned in a matrix detailing the saturation for each individual pixel. Hue is the last part and is confusing to me as to why it is somehow different.
Hue is the angular separation of the r1,g1,b1 pixels with respect to some reference point which is built into the equations I used. So for the hue calculation we need to first evaluate the input matrices which is what I did using your recommendation of matGreater, which is very useful by the way thanks again. Once we do this matGreater figures out which elements of blue are greater than green, and we can begin calculating hue for each pixel in R,G,B based on the values of r1,g1,b1. As you can see when B is greater than G so to will b1 and we use a specific calculation on this element using the values located in the same element of r1, g1, & b1. From here I want to be able to construct a matrix with values between (0,360) which will denote the hue angle of each pixel. Sorry for being so short in the beginning, I sometimes get caught up and forget not everyone is working on the same things I am, thanks for your patience. Take care.
Joe