Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Finding the Mean Value

Status
Not open for further replies.

Ejaz

Electrical
Dec 4, 2001
26
0
0
JP
I've written the following code to calculate the Mean Values of x, y & z.
***************************************************************
for i=2:size(A) % A = column of input data
x(i) = % formula
y(i) = % formula
z(i) = % formula
end

Mean_x=mean(x); % mean value of all the values of x
Mean_y=mean(y); % mean value of all the values of y
Mean_z=mean(z); % mean value of all the values of z
***************************************************************

With this code, the mean value is calculated for i=1:size(A)
taking x(1), y(1) & z(1) as 0. I need to calculate the mean for i=2:size(A), excluding x(1), y(1) & z(1). How can I do that? Thanks in advance!
 
Replies continue below

Recommended for you

Status
Not open for further replies.
Back
Top