0

Please solve my problem . My problem is that releted to random numbers and fitting data

Suppose I have random numbers , so I wanted to plot in histogram . My goal for this is my x axis is bins numbers and my y axis is data density . When I get x[ ] and y[ ] . Then I will fitt my histogram form fitting method So please give some code for this simple code

12th Sep 2021, 9:22 AM
Chandra Prakash
Chandra Prakash - avatar
4 Antworten
+ 3
Chandra Prakash , to get useful help from the community,  we need to see your attempt first. without having seen your code, it is difficult to find out where the issue is. => please put your code in playground and link it here thanks!
12th Sep 2021, 9:27 AM
Lothar
Lothar - avatar
- 2
int main(){ double area; double a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0; ifstream theFile ("Datafile.txt"); while(theFile >>area){ if (area<=0.05){ a++; } else if (area<=0.1){ b++; } else if (area<=0.15){ c++; } else if (area<=0.2){ d++; } else if (area<=0.25){ e++; } else if (area<=0.3){ f++; } else if (area<=0.35){ g++; } else if (area<=0.4){ h++; } else if (area<=0.45){ i++; } else if (area<=0.5){ k++; } else if (area<=0.55){ l++; } else if (area<=0.6){ m++; } else if (area<=0.65){ n++; } else if (area<=0.7){ o++; } else if (area<=0.75){ p++; } else if (area<=0.8){ q++; } else if (area<=0.85){ r++; } else if (area<=0.9){ s++; } else if (area<=0.95){ t++; } else if (area<=1.0){ u++; } }
12th Sep 2021, 10:00 AM
Chandra Prakash
Chandra Prakash - avatar