stats - function[mean stdev]=stats(x n=length(x mean=...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
%John Wade %example of a function with multiple outputs %input is a vector, output is mean and standard deviation.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: function [mean, stdev]=stats(x) n=length(x); mean= sum(x)/length(x) stdev=sqrt(sum((x-mean).^2/(n-1))); s...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online