Hey everyone,
I'm working on a function that sorts information out of multiple arrays and compares them together. I have a question about why one of my lines of code isn't working. Its line 21 of the script. I want it to give me the row and column of the original array 'y' but, it is giving me the row and column of the variable I created 'chon'. How do I get the row and column of the 'y' at the value position 'chon'?
Here is the function script
1:function loca = location (x,y)
2:% A function that finds the location of items within a given range in an array. The 3:output array is
4:% displayed so that the first column is the row of the inputed array the
5:% second column is the column of the inputed array and the third column is
6:% the value of the item from the inputed array.
7:high = input('What is the maximum threshold of intensity emission for the Molecule');
8:low = input('What is the maximum background intensity threshold');
9:range = find(x>low & x<high);
10:[row, column] = find(x>low & x<high);
11:locationx = [row, column, x(range)];
12:disp('The items in array One within the given range are:')
13:disp(locationx)
14:range = find(y>low & y<high);
15:[row, column] = find(y>low & y<high);
16:locationy = [row, column, y(range)];
17:disp('The items in array Two within the given range are:')
18:disp(locationy)
19:diff = xy;
20:chon = find(diff<0 & y>low & y<high);
21:[row,column] = find(y(chon));
22:locationon = [row,column,y(chon)]
Any ideas would be appreciated.
Thanks,
Garrett Banton
