average and std deviation of user input of a number of inputs, decided by user.

1 回表示 (過去 30 日間)
Hannah Tauriello
Hannah Tauriello 2020 年 2 月 20 日
回答済み: Chaitanya Mallela 2020 年 3 月 4 日
I'm trying to help my Fiance with her problem(I'm on her account) for her engineering programming class. I know a good bit about C++ and Java but I'm completely unaccustomed to MATLAB and so I'm not doing all that well helping her. Does anyone know how to do this? I would greatly appreciate the help, I've looked but there doesn't seem to be anything online that's the same. She has to use the mean and std deviation functions in the program as well.

回答 (1 件)

Chaitanya Mallela
Chaitanya Mallela 2020 年 3 月 4 日
The following code might help
clear all;
clc;
a=input('Enter the grades');
len = length(a);
m=mean(a);
sdev = std(a);
fprintf('There are %d grades\n',len);
In the Command window input the grades inside square bracket separated by comma.

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by