Scale ksdensity
Show older comments
Hello everyone.. I have data on my X-axis I import it from a file and I am trying to estimate the kernel function for it.. I believe the code for the kernel is right but I only can see my data(red) and not the kernel but I can see a blue line on the axes and I think its the kernel but not scaled .. I did the scaling for the data but don't know how to scale the ksdensity. I don't know how can you scale two different plots using axes? or is there another way I can make the kernel visible in my plot?
work = importdata('data.dat');
x = work(:,1);
X = (x).';
a= min(X);
b=max(X);
[xi,f]=ksdensity(X);
plot(f,xi);line(repmat(X,2,1),repmat([0;1],1,length(X)),'color','r' );axis([a b 0 40]);
Accepted Answer
More Answers (0)
Categories
Find more on Exploration and Visualization 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!