MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   hist 画直方图出错了,帮看看怎么改呀..?? (https://www.labfans.com/bbs/showthread.php?t=5538)

yang25107749 2008-11-29 13:17

hist 画直方图出错了,帮看看怎么改呀..??
 
a=[886,864,1027,918,866,926,893,919,946,978;928,1050,928,1040,905,900,900,863,926,821;999,927,978,854,954,999,800,981,895,924;946,949,816,1100,890,886,938,916,967,651;950,852,1000,900,1006,1120,864,818,921,850;]

a =
Columns 1 through 5
886 864 1027 918 866
928 1050 928 1040 905
999 927 978 854 954
946 949 816 1100 890
950 852 1000 900 1006
Columns 6 through 10
926 893 919 946 978
900 900 863 926 821
999 800 981 895 924
886 938 916 967 651
1120 864 818 921 850

k=ceil(1.87*(length(a)-1)^0.4);
[ni,ak]=hist(a,k);
fi=ni/length(a);
mfi=cumsum(fi);
stats=[[1:k]',ak',ni',fi',mfi']

[COLOR="Red"]??? Error using ==> horzcat
All matrices on a row in the bracketed expression must have the
same number of rows. [/COLOR]

hist(a)
h=findobj(gca,'Type','patch');
set(h,'FaceColer','y','EdgeColor','b')

[SIZE="5"]%其实我想用矩阵a编写一个 频率分布表和频率直方图,,,,,编的有毛病啊,咋整呀[/SIZE]

未注册 2008-11-29 13:51

回复: hist 画直方图出错了,帮看看怎么改呀..??
 
stats=[[1:k]',ak',ni',fi',mfi']

这句错了 转置了之后的每个变量的行数是不一样的

cloverose 2008-11-29 14:00

回复: hist 画直方图出错了,帮看看怎么改呀..??
 
stats=[[1:k]',ak',ni',fi',mfi']

这句是错的,每个变量转置之后的行数是不一样的~~

yang25107749 2008-12-01 10:25

回复: hist 画直方图出错了,帮看看怎么改呀..??
 
怎么改呢,,,帮帮我吧,我是菜鸟

yang25107749 2008-12-01 12:06

回复: hist 画直方图出错了,帮看看怎么改呀..??
 
我这个a 矩阵是个5行10列的 ,,,,,转置肯定不行,但是数据就是这个,,,,怎么才能绘制 a的 直方图和分布表呢


所有时间均为北京时间。现在的时间是 05:21

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.