hello all,
i wanna to change x in f=@(x)sinx to x+2 so that we have g=(x)sin(x+2)
how can i derive g from f in matlab?
thanks alot

 채택된 답변

the cyclist
the cyclist 2021년 5월 19일

0 개 추천

I think this is what you mean?
% Define f
f=@(x) sin(x);
% Derive g from f
g = @(x) f(x+2);
% Show that it gives expected result
f(2)
ans = 0.9093
g(0)
ans = 0.9093

추가 답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 5월 19일

0 개 추천

f=@(x)sin(x)
g = @(x)f(x+2)
Good luck

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2021년 5월 19일

댓글:

2021년 5월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by