How to do function shift in MATLAB?
Show older comments
Hello, I was wondering how can I do the function shinfting in MATLAB?
For example:
Input: f(x) = x+2 (a function) and 5 (the shifting value)
Output: f(x+5) = x+7 (a function)
2 Comments
Stephen23
on 27 Nov 2019
"How to do function shift in MATLAB?"
Hello, I was wondering how can I do the function shinfting in MATLAB?
For example:
Input: f(x) = x+2 (a function) and 5 (the shifting value)
Output: f(x+5) = x+7 (a function)
Rena Berman
on 12 Dec 2019
(Answers Dev) Restored edit
Answers (1)
Shubham Gupta
on 3 Oct 2019
Try:
function [ func_up ] = FuncShift( func, shift )
func_up = @(x)(func(x)+shift);
end
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!