In following plots, how can we measure intersect points?
3 次查看(过去 30 天)
显示 更早的评论
clear all
clc
for y=0.1:0.1:0.3;
G=[];
B=[];
for a=1:1:100
z=0.3;
x=y+sind(a);
G=[G x];
b=z+0.4;
B=[B b];
end
B;
G;
a=1:1:100;
plot(a,G,'-')
hold on
plot(a,B,'-')
end
0 个评论
采纳的回答
Kevin Holly
2023-2-16
for y=0.1:0.1:0.3
G=[];
B=[];
for a=1:1:100
z=0.3;
x=y+sind(a);
G=[G x];
b=z+0.4;
B=[B b];
end
B;
G;
a=1:1:100;
plot(a,G,'-')
hold on
plot(a,B,'-')
%spline1
s1 = spline(a,G);
%spline 2
s2=spline(a,B);
% find zeros
a0 = fzero(@(a) (ppval(s1,a)-ppval(s2,a)), 0) %Intersection point using spline interpolation
end
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spline Postprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!