Probability of matrix greater than multiple scalars

1 次查看(过去 30 天)
It should report to the screen probabilty of achieving NPV larger than some specified NPV (which is in the 10X1 matrix swtNPVProb.
our individual scalars are set up in a 10X1 matrix swtNPVProb = [-15000 -10000 -5000 0 5000]';.
the Npv's calculated from the program are in a 5000X1 matrix.
What should I do here? and if only two or some other number of probabilities is desired, then entries 3 to 10 should be set of swtNPVProb should be set to NaN.
Please help, as this assignment is due tomorrow. Thanks

回答(1 个)

Image Analyst
Image Analyst 2014-5-13
Get the probability by taking the histogram and normalizing it. Then get the cumulative distribution function by using cumsum. Then your answer is 1 - cdf(theValue). That's the percentage. Give it a shot. It's only like 5 or 6 lines so I'm sure you can do it.

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by