Conversion to double from function_handle is not possible
Show older comments
Hi, I'm new to Matlab and I got this error while trying to write down a function.
Can someone help me understanding where is the problem in my code?
function [errors] = first_fun(market_vol,strike_prices,ExerciseDates)
n = size(market_vol,2);
m = size(market_vol,1);
errors = zeros (n);
for j = 1:n
for i = 1:m
errors(i,j) = @(X) market_vol(i,j) - blackvolbysabr(X(1),Beta,X(2),X(3),Settle,ExerciseDates{j},ForwardValue,strike_prices(i));
end
end
end
Thanks
Accepted Answer
More Answers (0)
Categories
Find more on Data Type Conversion 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!