フィルターのクリア

Do I need to change to floating pts?

1 回表示 (過去 30 日間)
Ehi Eromosele
Ehi Eromosele 2014 年 2 月 12 日
回答済み: Image Analyst 2014 年 2 月 12 日
%Subscript indices must either be real positive integers or logicals. Error in linearinterp (line 5) plot(x, y, points, y(points), 'r+');%
function linearinterp
x=linspace(-5, 2*pi, 30);
y=exp(-x./2).*sin(x.^2+8);
points = refine(0, 7, 0.6);
plot(x, y, points, y(points), 'r+');
hold on
plot(points, y(points));
hold off
end
function points = refine(x1, x2, tol)
xm = (7)/2;
if abs((0.98935824662+0.01317103434)/2-0.171258585)<tol
points=[x1,x2];
else
left=refine(x1, xm, tol);
right=refine(xm, x2, tol);
points=[left, right(2:length(right))];
end
end

採用された回答

Image Analyst
Image Analyst 2014 年 2 月 12 日
In y(points) points must be an index 1,2,3,4,5,6,etc. or a logical vector [true, false, false, true, etc.}. It's probably not for you. What is the value of points?

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by