MATLAB: Finding the Y value corresponding to X value in a parametric plot

parametricplot

how do i find the value of Y when X= 1360 for every loop? X and Y gives a matrix. s is a random number for each loop
smax=0.4;
smin=0.1;
S=smin+rand(1,n)*(smax-smin);
S_cumulative=cumsum(S);
n= 3200;
R=200.04;
V=30;
v=20000;
i=1;
while i<n
t= linspace (0,50,100000);
X=R*sind((v*t/(R))+(V*(t))+S_cumulative(i);
Y=-R*cosd((v*t/R));
end
i=i+1;

Best Answer

If all your curves have the same timestep and same number of measurements why not put them all together in a matrix and then find the minimum? For example,
allY = rand(10,4); %say, you have 4 curves with 10 values (random data in this example)
X = (1:10)';
data_summary = [X allY] %put them together
intvl = 3:6; %in your case 1360 to 1400
minVals = min(data_summary(intvl,2:end))