Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 187190

Submitted on 7 Jan 2013 by Takehiko KOBORI

Correct

16Size
Leading solution size is 11.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
x = rand(1,10^6);
tic;
y_new=round(newRMS(x)*10^6)/10^6;
t_new=toc;
tic;
y_correct = round(sqrt(var(x,1)+mean(x)^2)*10^6)/10^6;
t_correct=toc;
assert(isequal(y_new,y_correct))
assert(t_new<t_correct)