Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding the Mean Value

Status
Not open for further replies.

Ejaz

Electrical
Joined
Dec 4, 2001
Messages
26
Location
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!
 
um...

Mean_x = mean(x(2:length(A));

M

--
Dr Michael F Platten
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top