Meshgrid in custom function
2 views (last 30 days)
Show older comments
Hello everybody,
I have a problem making a contourplot for a likelihoodfunction I am evaluating. Unfortunately, I can't figure out how I can evaluate my likelihoodfunction for a range of parametervalues. The likelihoodfunction has 2 parameters and an x vector containing 5000 observations (5000x1).
function [L]=likelihoodweibull(x,teta1,teta2)
l= (teta2/teta1).*(x./teta1).^(teta2-1).*exp(-(x./teta1).^teta2);
L=sum(log(l));
end
I now want to evaluate this function over several values for teta1 and teta2, so I can find a set of parameters for which likelihoodweibull = c, with c a fixed value. Therefore, I tried to make a contourplot for this function, but the function gives an error when using a meshgrid for a range of values is inserted in this function.
My question is: how can i evaluate this function for a meshgrid of values, and eventually make contourplot?
Thanks in advance, Robert
0 Comments
Answers (0)
See Also
Categories
Find more on Contour Plots 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!