Cody

Problem 236. newRMS

Solution 3057316

Submitted on 4 Oct 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
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)

x = Columns 1 through 17 0.1067 0.2448 0.7814 0.9563 0.6146 0.2615 0.0162 0.3510 0.8777 0.5677 0.7623 0.3027 0.5172 0.8686 0.4344 0.1914 0.8490 Columns 18 through 34 0.5361 0.8233 0.2950 0.0894 0.7092 0.0672 0.7747 0.1505 0.9605 0.3985 0.9322 0.4828 0.4404 0.5979 0.9661 0.7610 0.5044 Columns 35 through 51 0.0588 0.9155 0.5304 0.1893 0.7254 0.1607 0.3725 0.5298 0.5690 0.7639 0.1767 0.5019 0.6542 0.6660 0.9154 0.6452 0.4265 Columns 52 through 68 0.2680 0.6934 0.0334 0.9519 0.7996 0.9742 0.7424 0.9866 0.8347 0.3391 0.3682 0.6185 0.4175 0.9094 0.3605 0.1255 0.1088 Columns 69 through 85 0.1012 0.8820 0.6206 0.6373 0.3013 0.5631 0.3725 0.4505 0.6843 0.2015 0.6680 0.6638 0.2723 0.2022 0.1208 0.8895 0.6062 Columns 86 through 102 0.8263 0.7831 0.1478 0.8828 0.9491 0.1587 0.5742 0.2805 0.7835 0.4817 0.6460 0.3028 0.5060 0.7706 0.4428 0.2114 0.6110 Columns 103 through 119 0.4849 0.2816 0.7191 0.8783 0.0949 0.3452 0.8411 0.0148 0.0984 0.5342 0.8652 0.8831 0.0010 0.6935 0.2732 0.1612 0.7185 Columns 120 through 136 0.8618 0.0109 0.2061 0.8228 0.5419 0.4191 0.9186 0.8796 0.9687 0.5553 0.2648 0.2413 0.2357 0.8817 0.0643 0.4771 0.8883 Columns 137 through 153 0.8108 0.5671 0.1764 0.1846 0.7853 0.1863 0.5265 0.7450 0.2550 0.6743 0.9416 0.3804 0.0314 0.9379 0.9886 0.2520 0.8471 Columns 154 through 170 0.7046 0.2769 0.9631 0.0480 0.5423 0.7039 0.0608 0.4429 0.3880 0.3038 0.5342 0.7837 0.5161 0.6375 0.6560 0.7463 0.3224 Columns 171 through 187 0.1691 0.5929 0.2849 0.7316 0.7936 0.2393 0.5344 0.8619 0.9081 0.7967 0.8063 0.7276 0.8099 0.9528 0.4748 0.2207 0.0587 Columns 188 through 204 0.4509 0.9090 0.6807 0.9203 0.7698 0.6406 0.4408 0.6171 0.6800 0.3595 0.0085 0.5809 0.3055 0.8810 0.9347 0.3531 0.2129 Columns 205 through 221 0.0880 0.0239 0.8520 0.9914 0.8513 0.7292 0.7648 0.0340 0.7648 0.6365 0.9111 0.3186 0.9345 0.2854 0.2740 0.1635 0.3404 Columns 222 through 238 0.4706 0.0854 0.6765 0.4739 0.9610 0.5943 0.5176 0.9187 0.4169 0.6338 0.7518 0.7172 0.7513 0.1503 0.8707 0.4729 0.7416 Columns 239 through 255 0.7698 0.7321 0.1530 0.8395 0.8815 0.8603 0.4393 0.7567 0.0921 0.5025 0.4285 0.2047 0.5366 0.3895 0.6828 0.8994 0.2842 Columns 256 through 272 0.9150 0.9648 0.8608 0.7795 0.4524 0.5299 0.4433 0.5512 0.0387 0.6032 0.9818 0.6693 0.2875 0.2283 0.8904 0.8753 0.1452 Columns 273 through 289 0.5530 0.5782 0.1626 0.0763 0.2763 0.3524 0.6602 0.8134 0.5580 0.3456 0.7389 0.3849 0.5403 0.0209 0.8880 0.7560 0.9876 Columns 290 through 306 0.5429 0.1217 0.6953 0.9416 0.2652 0.4640 0.0749 0.9976 0.7466 0.7804 0.7658 0.6820 0.7464 0.4858 0.0267 0.7558 0.0921 Columns 307 through 323 0.3198 0.5196 0.9399 0.6388 0.5692 0.3363 0.3742 0.7018 0.1091 0.0781 0.7069 0.9962 0.0996 0.8030 0.9041 0.0875 0.6002 Columns 324 through 340 0.0055 0.9266 0.2999 0.1975 0.6016 0.2072 0.4160 0.7432 0.0518 0.1951 0.1125 0.9530 0.5223 0.8685 0.9365 0.8114 0.7287 Columns 341 through 357 0.9950 0.9265 0.5309 0.6592 0.6990 0.3109 0.1501 0.3631 0.4407 0.2164 0.0883 0.8054 0.3947 0.3703 0.3194 0.2451 0.3336 Columns 358 through 374 0.1273 0.4453 0.1280 0.9474 0.9361 0.2734 0.8579 0.7944 0.2929 0.3179 0.2022 0.6472 0.0221 0.9464 0.1572 0.8578 0.0920 Columns 375 through 391 0.6754 0.2603 0.3334 0.2219 0.3227 0.0291 0.3280 0.7461 0.5851 0.9018 0.6210 0.0026 0.0488 0.8164 0.9367 0.9762 0.1929 Columns 392 through 408 0.5825 0.8098 0.7839 0.8429 0.1735 0.5875 0.8475 0.7858 0.4033 0.3776 0.6856 0.5224 0.7765 0.8351 0.1403 0.8868 0.1399 Columns 409 through 425 0.1649 0.9809 0.0596 0.4985 0.9154 0.9119 0.5725 0.6342 0.7674 0.3933 0.9410 0.1115 0.8763 0.4141 0.6662 0.1808 0.4306 Columns 426 through 442 0.1798 0.3854 0.5221 0.9843 0.0854 0.1711 0.9334 0.4538 0.2426 0.8929 0.4092 0.3896 0.5776 0.3282 0.9331 0.6520 0.0966 Columns 443 through 459 0.3784 0.6822 0.2039 0.3212 0.3484 0.0858 0.8895 0.3201 0.7794 0.6194 0.4039 0.8846 0.4120 0.8676 0.0746 0.9777 0.2524 Columns 460 through 476 0.6889 0.1643 0.0603 0.5193 0.0874 0.1995 0.4728 0.2557 0.0739 0.1694 0.2810 0.0782 0.8253 0.2401 0.0692 0.8211 0.5803 Columns 477 through 493 0.5611 0.3674 0.7487 0.7009 0.9745 0.2884 0.2382 0.5430 0.6010 0.4077 0.4246 0.5889 0.8002 0.5317 0.1471 0.0394 0.9588 Columns 494 through 510 0.8351 0.8232 0.0955 0.6552 0.9989 0.5229 0.4831 0.8646 0.7106 0.2137 0.7026 0.0051 0.6318 0.9218 0.5263 0.1054 0.3615 Columns 511 through 527 0.8352 0.6720 0.0004 0.9025 0.0401 0.8115 0.0124 0.3505 0.0943 0.2503 0.2864 0.9608 0.3037 0.2505 0.0830 0.4361 0.2221 Columns 528 through 544 0.1262 0.2240 0.7099 0.2313 0.2135 0.8804 0.2643 0.4385 0.8919 0.1259 0.6476 0.9369 0.6875 0.0446 0.3836 0.8139 0.2539 Columns 545 through 561 0.9913 0.9665 0.6224 0.4419 0.2321 0.7931 0.1585 0.5540 0.7164 0.6838 0.1477 0.6250 0.1825 0.2904 0.0266 0.3082 0.7623 Columns 562 through 578 0.2122 0.4121 0.0504 0.1879 0.6312 0.2679 0.7536 0.9109 0.5522 0.6414 0.0436 0.0657 0.8589 0.3681 0.5807 0.3486 0.7756 Columns 579 through 595 0.4604 0.8398 0.5913 0.4384 0.5360 0.8976 0.8495 0.3281 0.4113 0.9386 0.9498 0.0166 0.5556 0.1623 0.1646 0.7961 0.0320 Columns 596 through 612 0.2316 0.5753 0.3007 0.6486 0.5348 0.9764 0.4722 0.5100 0.3622 0.5925 0.9473 0.2985 0.7740 0.1649 0.2030 0.7040 0.3540 Columns 613 through 629 0.0912 0.9741 0.9971 0.0898 0.2216 0.8872 0.1708 0.4152 0.3633 0.3199 0.8735 0.3735 0.3064 0.0087 0.5734 0.2440 0.5334 Columns 630 through 646 0.8018 0.8248 0.2683 0.9905 0.3955 0.0235 0.1810 0.6864 0.6116 0.2592 0.1427 0.2107 0.3194 0.8604 0.6653 0.7917 0.6839 Columns 647 through 663 0.6173 0.1388 0.1220 0.1980 0.3646 0.6258 0.1959 0.3607 0.4056 0.3553 0.8596 0.1424 0.3132 0.6200 0.9608 0.3525 0.6027 Columns 664 through 680 0.2388 0.3289 0.6261 0.3110 0.1436 0.7580 0.2044 0.8508 0.6116 0.9178 0.8242 0.7946 0.3641 0.8020 0.3522 0.7397 0.8998 Columns 681 through 697 0.3729 0.0382 0.3790 0.7375 0.1100 0.4341 0.0269 0.0986 0.3264 0.2285 0.8591 0.5129 0.0276 0.3157 0.9844 0.4287 0.0885 Columns 698 through 714 0.6655 0.5169 0.7504 0.3085 0.6052 0.6283 0.5955 0.4118 0.5869 0.6138 0.8603 0.0627 0.4502 0.2914 0.8009 0.4699 0.1531 Columns 715 through 731 0.0265 0.0895 0.3786 0.2571 0.1182 0.2276 0.7484 0.8357 0.4666 0.5975 0.8052 0.9410 0.0068 0.6018 0.4043 0.9347 0.4501 Columns 732 through 748 0.6507 0.4624 0.5161 0.2660 0.7280 0.0210 0.3756 0.0250 0.9177 0.8497 0.8704 0.9415 0.5289 0.4360 0.6401 0.8663 0.9977 Columns 749 through 765 0.5163 0.9034 0.6739 0.4772 0.1589 0.0839 0.6312 0.2566 0.3954 0.2675 0.1279 0.9818 0.4989 0.5798 0.2493 0.7703 0.7029 Columns 766 through 782 0.2473 0.5441 0.9185 0.6636 0.5604 0.2216 0.0954 0.7759 0.7363 0.4998 0.8797 0.3127 0.7058 0.9539 0.9616 0.6908 0.0393 Columns 783 through 799 0.9926 0.6976 0.1922 0.2934 0.9412 0.8140 0.3765 0.5911 0.3481 0.7116 0.6651 0.1348 0.3399 0.8898 0.6391 0.2438 0.9966 Columns 800 through 816 0.2597 0.2765 0.0465 0.4173 0.5241 0.4308 0.9871 0.9409 0.5468 0.7200 0.1572 0.1981 0.9332 0.0279 0.1204 0.1648 0.8838 Columns 817 through 833 0.3759 0.7037 0.4775 0.5229 0.9298 0.3179 0.6686 0.5988 0.8865 0.8740 0.3679 0.8952 0.9875 0.2230 0.9786 0.3081 0.3098 Columns 834 through 850 0.5508 0.4173 0.9994 0.0449 0.2202 0.2459 0.8400 0.9442 0.0147 0.8399 0.4353 0.6250 0.6294 0.7794 0.7969 0.1439 0.1422 Columns 851 through 867 0.6368 0.3543 0.9775...

Output argument "ans" (and maybe others) not assigned during call to "newRMS". Error in Test1 (line 3) y_new=round(newRMS(x)*10^6)/10^6;

Suggested Problems

More from this Author100

Community Treasure Hunt

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

Start Hunting!