Calculating and Plotting Weibull Distribution Function(wblpdf) with Cell Arrays
11 次查看(过去 30 天)
显示 更早的评论
Hi, so I calculated weibull parameters for my cell array using this, where speedMsAWPcells is a set of 12 arrays.
weibullAWPcells = cellfun(@(C) wblfit(C), speedMsAWPcells, 'uniform', 0);
The output was the pairs of parameters as shown:
I would like to know how to apply the sets of weibull parameters to the weibull probability density function (wblpdf()) to calculate the individual wblpdf for each set of parameters in the cell array.
The range I am plotting the wblpdf for is as follows
X=0:0.5:27;
wblpdf(X,c,k);
% Where c = scale parameter, k = shape parameter
Lastly, I would like to know if there is some way to plot all of these wblpdfs against each other in the same plot without extracting them and then plotting them against each other, one at a time using hold on, hold off...
0 个评论
采纳的回答
Paul
2021-3-15
Here's an example that you might be able to adapt to your needs.
>> params = {[1 2];[2 3];[3 4]}; % define cell array with parameters for three Weibull densities
>> x=0:.1:5; % define x values to evaluate the densities
>> figure;hold on
>> p=cellfun(@(x,params) plot(x,pdf('Weibull',x,params(1),params(2))),repmat({x},size(params,1),1),params); % plot the densities, return handles to lines
>> set(p(1),'Marker','o'); % add some markers to the first line
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!