matlab如何画分布列直方图
data=readtable('ex1.xlsx'); d=data.math; y=[60:10:100]; histcounts(d,y); histogram(d,y); ax=gca; ax.XTick=y;
用matlab画直方图!!
[a,b]=hist(x,9); a=a/length(x); bar(b,a);
MATLAB怎么输出一幅图的直方图?用哪个函数?
>>x = -5:0.1:5; >>y = randn(1000,1); >>hist(y,x)
如何使用matlab进行直方图的编辑?
或者在 matlab下边输入 help imhist
edit histeq
%%%灰度图象的直方图数据%%%
clc
clear
fn='rice.tif';
I=imread (fn);
J=I;
%计算灰度图象的直方图数据
L=256; %灰度级
Ps = zeros(L,1); %统计直方图结果数据
nk=zeros(L,1);
[row,col]=size(I);
n=row*col; %总像素个数
for i = 1:row
for j = 1:col
num = double(I(i,j))◆1; %获取像素点灰度级
nk(num) = nk(num)◆1; %统计nk
end
%计算直方图概率估计
for i=1:L
Ps(i)=nk(i)/n;
figure;
subplot(3,1,1);imshow(J),title('原图');
subplot(3,1,2),plot(nk),title('直方图(nk)');
subplot(3,1,3),plot(Ps),title('直方图(Ps)');
%figure(4),imhist(hist);
%p=imhist(hist); %生成直方图函数,返回灰度图象直方图数据
%figure(5),plot(p);
以上就是土嘎嘎小编大虾米为大家整理的相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!