help with function to solve mean

median and mean without using the functions

3 件のコメント

Steven Lord
Steven Lord 2017 年 11 月 16 日
Let's say I handed you a piece of paper with a list of numbers on it. How would you (no computer involved) compute the mean and median of that list with pencil and paper? Can you write a function that does the same set of steps you would?
Steven Lord
Steven Lord 2017 年 11 月 16 日
Can you show us what you have so far? That way we can offer specific suggestions for your implementation.
phoenix_47
phoenix_47 2017 年 11 月 16 日
Can I private message you?

サインインしてコメントする。

回答 (1 件)

KL
KL 2017 年 11 月 16 日

0 投票

First you need to learn to create an array. You could either use concatenation operator - [] or the semicolon operator,
once you have that you need to learn how to create functions,
Passing arrays into functions is just like passing a scalar, for example,
function [out_mean, out_median] = calculateMeanMedian(inputArray)
%your calculation
end
To do the computation in your function, you need to learn how to index arrays in matlab and then how to use a loop,
now all you need to do is to get started, good luck!

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

質問済み:

2017 年 11 月 16 日

編集済み:

2017 年 11 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by