help with function to solve mean
10 次查看(过去 30 天)
显示 更早的评论
median and mean without using the functions
3 个评论
Steven Lord
2017-11-16
Can you show us what you have so far? That way we can offer specific suggestions for your implementation.
回答(1 个)
KL
2017-11-16
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!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!