Ai
1 Star 0 Fork 0

Vincent/MATLAB_Study

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
lesson13.m 985 Bytes
一键复制 编辑 原始数据 按行查看 历史
VINCENT 提交于 2022-10-23 19:25 +08:00 . MATLAB学习(修改版1)
%%
%1.拿出数值
load stockreturns;
x4 = stocks(:,4);
%mean平均数
mean(x4)
%median中位数
median(x4)
%mode数据集中最多的值
mode(x4)
%prctile数据集的百分比
prctile(x4)
%max最大值
max(x4)
%min最小值
min(x4)
%std标准方差
std(x4)
%var方差
var(x4)
%%
%统计图表
x = 1:14;
freqy = [1 0 1 0 4 0 1 0 3 1 0 0 1 1];
subplot(1,3,1); bar(x,freqy); xlim([0 15]);
subplot(1,3,2); area(x,freqy); xlim([0 15]);
subplot(1,3,3); stem(x,freqy); xlim([0 15]);
%%
%box图表
marks = [80 81 81 84 88 92 92 94 96 97];
boxplot(marks)
prctile(marks, [25 50 75])
%box图表(stocks中的数据)
boxplot(stocks)
%%
%skewness偏斜状态图
X = randn([10 3])*3;
X(X(:,1)<0, 1) = 0; X(X(:,3)>0, 3) = 0;
boxplot(X, {'Right-skewed', 'Symmetric', 'Left-skewed'});
y = skewness(X)
%%
%exercise
y = skewness(stocks)
k = kurtosis(stocks)
boxplot(y,k)
%%
%置信区间
load stockreturns;
x1 = stocks(:,3); x2 = stocks(:,10);
boxplot([x1, x2], {'3', '10'});
[h,p] = ttest2(x1, x2)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
其他
1
https://gitee.com/Vincentstudy/MATLAB_Study.git
git@gitee.com:Vincentstudy/MATLAB_Study.git
Vincentstudy
MATLAB_Study
MATLAB_Study
master

搜索帮助