Remove polynomial trend from data in the Live Editor
The Remove Trends task lets you interactively remove a polynomial trend in data. The task automatically generates MATLAB® code for your live script.
Using this task, you can:
Choose the degree of the polynomial trend to remove from data in a workspace variable.
Dynamically arrange breakpoints to define piecewise segments of the data.
Specify continuity constraints.
Automatically visualize the computed trend and data with the trend removed.
Open the Task
To add the Remove Trends task to a live script in the MATLAB Live Editor:
On the Live Editor tab, click Task and select the Remove Trends icon .
In a code block in the live script, type a relevant keyword, such as
detrend. Select Remove Trends from the suggested command completions.
Version HistoryIntroduced in R2019b
R2022a: Live Editor task does not run automatically if inputs have more than 1 million elements
Behavior changed in R2022a
This Live Editor task does not run automatically if the inputs have more than 1 million elements. In previous releases, the task always ran automatically for inputs of any size. If the inputs have a large number of elements, then the code generated by this task can take a noticeable amount of time to run (more than a few seconds).
When a task does not run automatically, the Autorun icon is disabled.
To run a task manually, on the Live Editor tab, click the Run Section button.
To enable running the section automatically, click the Autorun icon. The icon updates to display the enabled state.