what will be the program in matlab to find the average of various numbers?

6 Ansichten (letzte 30 Tage)
average means the sum of a list of numbers divided by the size of the list, in other words the arithmetic mean.

Akzeptierte Antwort

Andrew Reibold
Andrew Reibold am 29 Mai 2013
mean(X)
where X is a vector of the list of numbers
OR
mean([1 3 4 5 7 3])
Where your numbers are in the square brackets

Weitere Antworten (4)

per isakson
per isakson am 29 Mai 2013
  2 Kommentare
Dwayne
Dwayne am 29 Mai 2013
i dont know programming... i need a complete program, if possible for u, please help...
Matt Kindig
Matt Kindig am 29 Mai 2013
There really isn't any more programming to give you. Andrew's answer is literally all you need.

Melden Sie sich an, um zu kommentieren.


Olayemi Akinsanya
Olayemi Akinsanya am 12 Sep. 2017
Bearbeitet: Walter Roberson am 17 Mär. 2024
function resultv = mymean(P)
mysum=0;
for i=length(P)
mysum= mysum +(i);
end
resultv = mysum/length(P);
end

Salam Adil
Salam Adil am 19 Jun. 2021
write aprogram by matlab to calculate the average of 9 subject of student and then write the description of his average

Rajesh
Rajesh am 17 Mär. 2024
What is a correct matlab statement that will find the average of the prime numbers in a given 1D matrix A.
  1 Kommentar
Steven Lord
Steven Lord am 17 Mär. 2024
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the free MATLAB Onramp tutorial to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by