I want to calculate the sqaure root of the mean sqaured differences of succesisve numbers. Can anyone explain of how to calculate this in matlab if possible with an example for a set of numbers.
thanks.
Best Answer
Stefan, what happened when you tried this:
m = sort(rand(1, 7)); % create sample data
mDiff = diff(m)
meanSquareOfDiffs = mean(mDiff .^ 2)
ms = sqrt(meanSquareOfDiffs)
It seems pretty easy if you just take it a step at a dime. Heck, you could even have used a for loop if you really got stuck and needed a simple brute force method. What did you try that didn't work?
If this is part of an assignment (which the phrasing suggests to me) then you are probably expected to implement yourown code that does what rms() is supposed to do.
Best Answer