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

조회 수: 36 (최근 30일)
average means the sum of a list of numbers divided by the size of the list, in other words the arithmetic mean.

채택된 답변

Andrew Reibold
Andrew Reibold 2013년 5월 29일
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

추가 답변 (4개)

per isakson
per isakson 2013년 5월 29일
  댓글 수: 2
Dwayne
Dwayne 2013년 5월 29일
i dont know programming... i need a complete program, if possible for u, please help...
Matt Kindig
Matt Kindig 2013년 5월 29일
There really isn't any more programming to give you. Andrew's answer is literally all you need.

댓글을 달려면 로그인하십시오.


Olayemi Akinsanya
Olayemi Akinsanya 2017년 9월 12일
편집: Walter Roberson 2024년 3월 17일
function resultv = mymean(P)
mysum=0;
for i=length(P)
mysum= mysum +(i);
end
resultv = mysum/length(P);
end

Salam Adil
Salam Adil 2021년 6월 19일
write aprogram by matlab to calculate the average of 9 subject of student and then write the description of his average

Rajesh
Rajesh 2024년 3월 17일
What is a correct matlab statement that will find the average of the prime numbers in a given 1D matrix A.
  댓글 수: 1
Steven Lord
Steven Lord 2024년 3월 17일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by