【问题标题】:recovering the argument of a sinusoidal function in matlab在matlab中恢复正弦函数的参数
【发布时间】:2016-03-15 19:50:57
【问题描述】:

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

【问题讨论】:

    标签: matlab arguments unwrap


    【解决方案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'})
    

    【讨论】:

    • @CarolinaRickenstorff 如果它满足您的需求,请考虑接受答案(同样适用于您之前的问题)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-25
    • 1970-01-01
    相关资源
    最近更新 更多