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)

2 Commenti

Original question from Google Cache:
"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)
(Answers Dev) Restored edit

Accedi per commentare.

Risposte (1)

Try:
function [ func_up ] = FuncShift( func, shift )
func_up = @(x)(func(x)+shift);
end

Categorie

Richiesto:

H
H
il 3 Ott 2019

Commentato:

il 12 Dic 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by