Help using the FIND function
Help using the FIND function
(OP)
Hi all,
Quick question - I'm tryin to implement the following line of code:
inx01=find(X1==bt01);
and I get the error ??? Error using ==> find
Second argument must be a positive scalar integer.
If I replace bt01 with the value it works, but I need to leave this as bt01. Is there a way to work around this?
Thanks,
Chris
Quick question - I'm tryin to implement the following line of code:
inx01=find(X1==bt01);
and I get the error ??? Error using ==> find
Second argument must be a positive scalar integer.
If I replace bt01 with the value it works, but I need to leave this as bt01. Is there a way to work around this?
Thanks,
Chris





RE: Help using the FIND function
Give us an X1 sample array and a bt01 value.
RE: Help using the FIND function
RE: Help using the FIND function
bt01=(Htotal-2*Rbulb-Tflange)/Ttee; % which equals 8.8095 for this case
Thanks,
Chris
RE: Help using the FIND function
RE: Help using the FIND function
Y1=interp1(x_1EF,yfit,X1);
plot(X1,Y1,'r');
bt01=(Htotal-2*Rbulb-Tflange)/Ttee;
inx01 = find(X0==bt01);
Z01=Y0(inx01);
RE: Help using the FIND function
The second to last line should read
inx01 = find(X1==bt01);
I copied from the wrong part of the script.
RE: Help using the FIND function
You may be thinking the index is 13096, but bt01 has more precision than shown, so find doesn't find an exact index. Try rounding it to 4 places. Maybe better solution would be to fit the data to a shifted spline and look for a zero (reverse interpolation).