Error using trapz. Point spacing must be a scalar specifying uniform spacing or a vector of x-coordinates for each data point.
Show older comments
Plot_X = 0:0.01:1;
Per = quantile(SUSC_MO,1:-0.01:0);
for i = 1:101
if i <101
Plot_Y(i) = sum(CAT_M(SUSC_MO>=Per(101-i))) / sum(CAT_M,'all');
else
Plot_Y(i) = sum(CAT_M(SUSC_MO>=0)) / sum(CAT_M,'all');
end
end
AUC= round(100*trapz(Plot_X,Plot_Y),1);
the error is in line 10.
Accepted Answer
More Answers (0)
Categories
Find more on Numerical Integration and Differentiation 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!