Hi,
I would like to know, how is it possible to find out the exact intersection of a row and a column from a matrix. It should only deliver one value as the answer (like manually reading the intersect of the row and column from a table).
Below is an analog to what I am doing. The matrix which I am working with is a 35×41 matrix.
As an example, by using the code below, if im searching for the intersect of x==1 and y==3, I will get P=[1;2] but I expact 2 as the answer. Is there any way to realisize this?
Thank you!
p=[1 2 3;4 1 2;2 8 1];x=input('x?')if x==1x=p(:,1)elseif x==2x=p(:,2)elseif x==3x=p(:,3)endy=input('y?')if y==1y=p(1,:)elseif y==2y=p(2,:)elseif y==3y=p(3,:)endP=intersect(x,y)
Best Answer