i just start to learn matlabing but i have a small question
if i want to calculate the mean, standard deviation and coefficient of variation for a numbers that user enter ( asking the user to enter the numbers he wants )
how i am gonna do that ? how my code should looks like ?

 Accepted Answer

Hi Mishal,
If you want the user to capture the data from the command line you can use the input function, something like:
dataArray = input('Provide the values for calculation: ')
Then the user can capture the data as a vector or matrix and after you can calculate the mean, standard deviation, etc.
Provide the values for calculation: [1,2,3,4,5,6,7,8,9]
>> mean(dataArray)
ans =
5
>> std(dataArray)
ans =
2.7386

More Answers (0)

Categories

Find more on Parallel Computing in Help Center and File Exchange

Asked:

on 6 Feb 2021

Answered:

on 6 Feb 2021

Community Treasure Hunt

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

Start Hunting!