Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8368369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:22:26+00:00 2026-06-09T13:22:26+00:00

I am facing some error to plot the CDF for Triangular distribution; I can

  • 0

I am facing some error to plot the CDF for Triangular distribution; I can plot the histogram using Generating a Triangular distribution in MATLAB, but how do I plot the CDF?

n = 10000; %Random number 
a = 0.26; %Min 
b = 0.46; %Max
c = 0.35; %Mode 
u = rand(n, 1); 
x = zeros(n, 1);
for i = 1:n   
    U = u(i);   
    if U < (c-a)/(b-a);    
        X = a + sqrt(U*(b-a)*(c-a)); 
    else       
        X = b - sqrt((1-U)*(b-a)*(b-c));  
    end    
    x(i) = X; 
end 
hist(x,100)

if a <= x && a <=c
  cdf = (x-a)^2/12
elseif c <= x && x <= b
  cdf = 1-(b-x)^2/4
end

if 0 <= p && p <= 0.75
  INV = a+2*sqrt(3*p);
elseif 0.75 <= p && p <= 1
  INV = b-2*sqrt(1-p)
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:22:28+00:00Added an answer on June 9, 2026 at 1:22 pm

    I probably miss something, But why won’t the following do?
    y=hist(x,100);
    cdf=cumsum(y);
    plot(cdf)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to pass query string in anchor tag but facing some error i.e
I am facing some issues while serializing objects (I am using JBoss Drools, and
I am facing some problems for using placement new for contiguous memory.Please guide me,
I am using mysql and facing some problem. I want to retrieve last row
I am trying to implement Google Map but I am facing some problem with
Scenario: I have configured SQOOP on my PC. But I am facing some problem
I'm facing strange error. I use Glassfish 3.1.1 withn jdk7 and since some time
I'm facing some doubts in PHP database connections. Since I can't just put a
I am facing some issues regarding tomcat startup and shutdown. I am using Tomcat
I am using PyMySQL-0.5.0 and facing an obscure'ish error/exception when loading data from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.