matlab的编程问题,求关于平均数,最小值,最大值,方差等简单的数据处理的程序。

2024-11-08 11:59:35
推荐回答(5个)
回答(1):

如果数据都放在a.txt记事本中。
代码如下:(如果a是向量这按下面的,如果是矩阵,需算两次)
load 'a.txt'
amin=min(a);%%最小值 若为矩阵,则amin=min(min(a))
amax=max(a);%%最大值 同上
aavg=mean(a);%%平均值 同上
avar=var(a);
plot(a);

回答(2):

>> help stats

Descriptive Statistics.
bootci - Bootstrap confidence intervals.
bootstrp - Bootstrap statistics.
corr - Linear or rank correlation coefficient.
corrcoef - Linear correlation coefficient (in MATLAB toolbox).
cov - Covariance (in MATLAB toolbox).
crosstab - Cross tabulation.
geomean - Geometric mean.
grpstats - Summary statistics by group.
harmmean - Harmonic mean.
iqr - Interquartile range.
jackknife - Jackknife statistics.
kurtosis - Kurtosis.
mad - Median Absolute Deviation.
mean - Sample average (in MATLAB toolbox).
median - 50th percentile of a sample (in MATLAB toolbox).
mode - Mode, or most frequent value in a sample (in MATLAB toolbox).
moment - Moments of a sample.
nancov - Covariance matrix ignoring NaNs.
nanmax - Maximum ignoring NaNs.
nanmean - Mean ignoring NaNs.
nanmedian - Median ignoring NaNs.
nanmin - Minimum ignoring NaNs.
nanstd - Standard deviation ignoring NaNs.
nansum - Sum ignoring NaNs.
nanvar - Variance ignoring NaNs.
partialcorr - Linear or rank partial correlation coefficient.
prctile - Percentiles.
quantile - Quantiles.
range - Range.
skewness - Skewness.
std - Standard deviation (in MATLAB toolbox).
tabulate - Frequency table.
trimmean - Trimmed mean.
var - Variance (in MATLAB toolbox).

回答(3):

对于一列或一行数据x
最小值:min(x)
最大值:max(x)
均值:mean(x)
方差:var(x)
作图:plot(x)

回答(4):

就是一些气象数据,经济数据,粮食产量等数据求平均,最小,最大值,方差等如果数据都放在a.txt记事本中。代码如下:(如果a是向量这按下面的,如果是

回答(5):

我的妈啊 那么多 好头疼哦