Clear, clc% I will like to find intersection of two random variables.%Supose A and B below are stocks.Please use MATLAB% Generate 100 time points and A and B stocks: returns and volumesA = randn(100,1); %stock AB = abs(randn(100,1)*1e4); %stock B
% I want to find the intersection of stock A and stock B
%Please note C = intersect(A,B) Does not work. Since A and B are random%using C = intersect(A,B) will generate an empty set
% I am not sure if the intersection should be% C=A-B; or C=A.*B;
% I tried both the minus looks closer to what I want but am not sure I am doing the right thing