Kernel Density for 2D data
이전 댓글 표시
I have two series of data(both of type double). I want to generate a kernel density plot from these. Pls help. My coding is given below.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
curs1 = exec(conn, 'select sp_x, sp_y from road_part6_trajectories_oneway2_new_segments_cartesian2');
format long;
curs1 = fetch(curs1);
AA = curs1.Data;
x = [AA{:,1}]';
y = [AA{:,2}]';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I want to generate the kernel density or any other suitable density plot for x and y. pls advise.
채택된 답변
추가 답변 (1개)
Very helpful. After changing x and y to variables from my data. I have this diagram

Is there any way to change the z-axis to normalized density estimates or probabilities?
댓글 수: 1
Joseph Byrnes
2022년 4월 19일
normalize the area under the curve to 1
카테고리
도움말 센터 및 File Exchange에서 Kernel Distribution에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!