Given an array of known point values (Xpoints), which is a 1 x 11 array I'm trying to search and generate a list of index locations that correspond to when the X_ValueTrans (1 x 501) equals the individual elements in the Xpoints array. The following code is able to located the first three but on the fourth time through the loop I get the following error. Below the error message I have posted the code sample I am using. In addition, I have changed the loop1 step thinking it couldn't find the fourth value. However, I changed the step size of the for loop to 2 and it still only finds the first three terms. I must be missing something
--------- Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-0.
Error in PlotCurve (line 34) XpIndex (1, loop1) = [col]
XpIndex = zeros(1, length(Xpoints)); X_ValueTran = X_Value'
for loop1 =1:1: NumberLines+1
[row,col] = find(X_ValueTran == Xpoints(1,loop1))
XpIndex (1, loop1) = [col]