Matlab function holding first value?

1 次查看(过去 30 天)
Hello everyone!
a=2;
b=3;
f=@(x) a*x+b;
f(1)=5
if I set
b=0;
f(1)=5
Why is this?

回答(1 个)

Mischa Kim
Mischa Kim 2016-11-18
Hi Péter, this is explained well in the documentation here.

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by