Help with anonymous function
Show older comments
I have always used a separate file for all my functions, but it's rather odd to have as many files as mathematical expressions in my code. So I am trying to used anonymous function, but I haven't been able to use them. Here is a simple example:
clc;
clear all;
a=.1;
prob = @(x) a-a*exp(-x);
y = 10*prob;
y(15)
What is the right way to fix such a code?
Accepted Answer
More Answers (0)
Categories
Find more on Time and Frequency Domain Analysis 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!