Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 如何在原始数据下获得一行_Matlab - Fatal编程技术网

Matlab 如何在原始数据下获得一行

Matlab 如何在原始数据下获得一行,matlab,Matlab,我只有关于黑线的数据,我想得到黄色区域。 那么我怎样才能在MATLAB上得到红线呢? 请帮帮我 试试这个例子: %create a sample periodic curve t=0:.1:31.4; upper = (100-t.^2).*cos(t+pi); %take first derivative of the curve diff1 = diff(upper); %find the lowest points of the original curve lower_x = fin

我只有关于黑线的数据,我想得到黄色区域。 那么我怎样才能在MATLAB上得到红线呢? 请帮帮我

试试这个例子:

%create a sample periodic curve
t=0:.1:31.4;
upper = (100-t.^2).*cos(t+pi);

%take first derivative of the curve
diff1 = diff(upper);

%find the lowest points of the original curve
lower_x = find([diff1>0 0] & [0 diff1<0]); %rising zero crossings
lower_y = upper(lower_x);

%interpolate between points of the lower curve
lower = spline(lower_x,lower_y,0:size(t,2)-1);

%display
figure; hold on;
plot(t,upper,'b');
plot(t,lower,'r');
%创建采样周期曲线
t=0:1:31.4;
上限=(100-t.^2)。*cos(t+pi);
%取曲线的一阶导数
diff1=diff(上);
%找到原始曲线的最低点

lower_x=查找([diff1>0]&[0 diff1I我想如果你发布了一个包含样本数据和当前代码的示例,那么帮助你会更容易。这很简单,你只需要打开Matlab并编写一个算法,在给定黑线的情况下计算红线……哦,等等,你想让我们帮你做吗?很抱歉,缺少信息。我只有关于黑线的数据点我刚才问我可以用哪个函数。