Write a function that takes a vector xyz and returns as output two variables

Hi, I'm new to MATLAB and i'm trying to solve this problem:
Write a function: named myAver that takes a vector xyz as input argument and returns as output two variables: scalar Mav which stores an average value of the vector and logic variable err. You cannot use MATLAB mean function.

1 comentario

Is there a specific portion that you are getting stuck on. As this is a homework problem you'll find few people to directly answer it for you. please read http://www.mathworks.com/matlabcentral/answers/8626-how-do-i-get-help-on-homework-questions-on-matlab-answers to how to phrase your homework questions for people to help you out here.

Iniciar sesión para comentar.

Respuestas (1)

Youssef  Khmou
Youssef Khmou el 27 de Abr. de 2015
Editada: Youssef Khmou el 27 de Abr. de 2015
try :
function [Mav,Err]=myAver(u)
% hint : use sum, length, std,...

2 comentarios

Its generally best if you don't give a student (especially ones with novice questions for homework) the complete code for their homework. This helps nobody, and certainly not the student.
answer is altered.

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 27 de Abr. de 2015

Editada:

el 27 de Abr. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by