0

我有一个看起来像正弦曲线的实验测量,因此函数可以建模为sin(x). 如果我将该asin函数应用于数据,我会得到一个三角形函数。我想知道是否有一种形式可以像 unwrap 那样获得与 x 对应的直线。任何意见将不胜感激。

4

1 回答 1

1

unwrap仅适用于函数跳转的锯齿模式。所以我的想法是从你的函数中创建这样一个锯齿模式,然后应用展开。

%example function
x=0:.1:10;
y=sin(x);
%invert
x1=asin(y);
%detect rising and falling
s=[true,diff(x1)>0];
%continue falling segments rising, using the negative slope
x2=x1.*s+(pi-x1).*(1-s);
%finally use unwrap
x3=unwrap(x2);

%code for the plot
%plot(x,y,x,x1,x,s,x,x2)
%legend({'y','x1','s','x2'})

在此处输入图像描述

于 2016-03-15T20:18:24.600 回答