Cody

Solution 2158472

Submitted on 13 Mar 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.1135 0.7507 0.3942 0.0384 0.5599 0.5487 0.1411 0.3220 0.8520 0.6767 0.9585 0.5452 0.4824 0.3340 0.7863 0.0703 0.8346 Columns 18 through 34 0.9912 0.5995 0.5497 0.2724 0.3107 0.7910 0.1435 0.3959 0.0786 0.6438 0.1407 0.9238 0.5624 0.3761 0.6445 0.3120 0.4313 Columns 35 through 51 0.4548 0.1933 0.6394 0.1327 0.1528 0.9483 0.6296 0.0209 0.2949 0.2669 0.0777 0.8106 0.4997 0.7121 0.5915 0.0707 0.4610 Columns 52 through 68 0.6509 0.7945 0.4436 0.3287 0.7851 0.6717 0.1141 0.0659 0.2744 0.0646 0.4618 0.8892 0.0596 0.1356 0.8761 0.0585 0.7639 Columns 69 through 85 0.3517 0.7838 0.9897 0.8181 0.4309 0.8362 0.7630 0.2929 0.2927 0.9128 0.5693 0.8410 0.0026 0.1401 0.7117 0.2288 0.6110 Columns 86 through 102 0.8120 0.0246 0.5733 0.6039 0.5139 0.6337 0.3692 0.1218 0.3717 0.6651 0.4817 0.2933 0.7187 0.3383 0.9304 0.4507 0.2043 Columns 103 through 119 0.0210 0.6574 0.0078 0.0126 0.4878 0.0587 0.2335 0.2666 0.3801 0.9652 0.4673 0.7031 0.7956 0.5998 0.6972 0.9970 0.9495 Columns 120 through 136 0.7455 0.9216 0.0360 0.9332 0.3910 0.4768 0.2500 0.5387 0.9615 0.7413 0.1528 0.5401 0.1614 0.7932 0.4481 0.5837 0.7529 Columns 137 through 153 0.8323 0.4562 0.9068 0.1057 0.7760 0.6761 0.7200 0.4657 0.2948 0.8540 0.6059 0.6547 0.9338 0.7982 0.0473 0.9905 0.5327 Columns 154 through 170 0.2984 0.5607 0.2780 0.2911 0.7900 0.5838 0.2646 0.7750 0.4521 0.8532 0.0545 0.7923 0.8057 0.2850 0.4414 0.1768 0.7996 Columns 171 through 187 0.2026 0.4863 0.2797 0.7821 0.2651 0.3663 0.2996 0.1551 0.2877 0.0236 0.1400 0.9894 0.3941 0.6416 0.7013 0.4761 0.8792 Columns 188 through 204 0.3100 0.6615 0.9574 0.9742 0.1793 0.3410 0.1242 0.8462 0.8627 0.3604 0.2869 0.0197 0.7264 0.0428 0.0182 0.2481 0.3167 Columns 205 through 221 0.0506 0.5139 0.2906 0.8725 0.2895 0.1553 0.6074 0.3724 0.6112 0.5362 0.3906 0.0548 0.7304 0.6231 0.9721 0.9730 0.8835 Columns 222 through 238 0.8925 0.1514 0.1435 0.4115 0.2649 0.1112 0.3222 0.4517 0.5469 0.5820 0.0063 0.2864 0.4673 0.4605 0.9077 0.6596 0.5044 Columns 239 through 255 0.9180 0.3023 0.3319 0.3965 0.1420 0.6674 0.3179 0.7517 0.6986 0.5943 0.7526 0.9700 0.5074 0.7109 0.0508 0.0399 0.9114 Columns 256 through 272 0.6139 0.4583 0.7047 0.9373 0.3005 0.2992 0.8228 0.8679 0.8799 0.0639 0.6171 0.1333 0.5292 0.7271 0.1899 0.6251 0.7578 Columns 273 through 289 0.1430 0.7599 0.0429 0.1582 0.4818 0.8140 0.8394 0.1737 0.6675 0.8889 0.3922 0.8683 0.9874 0.0659 0.1710 0.5644 0.6515 Columns 290 through 306 0.0115 0.9889 0.5819 0.7439 0.7432 0.1420 0.5761 0.7094 0.7129 0.7735 0.1990 0.2907 0.7252 0.5570 0.8484 0.5273 0.6782 Columns 307 through 323 0.4721 0.8998 0.7253 0.0283 0.8736 0.3134 0.1462 0.2488 0.0727 0.6236 0.8367 0.7171 0.4607 0.4197 0.4427 0.1034 0.4441 Columns 324 through 340 0.5021 0.5139 0.1359 0.7086 0.6172 0.8989 0.4565 0.6707 0.3063 0.2191 0.1601 0.7738 0.0510 0.8656 0.1853 0.8341 0.9736 Columns 341 through 357 0.0393 0.9401 0.1544 0.7139 0.1626 0.2020 0.0897 0.1430 0.5019 0.2249 0.4296 0.5289 0.5755 0.5350 0.2190 0.8959 0.6269 Columns 358 through 374 0.4960 0.5445 0.7043 0.1567 0.3178 0.1823 0.2815 0.8230 0.7076 0.3787 0.7473 0.4059 0.5276 0.0196 0.5708 0.0439 0.8838 Columns 375 through 391 0.3482 0.4913 0.1565 0.2620 0.7961 0.4164 0.3923 0.6870 0.9535 0.9240 0.5839 0.9220 0.0891 0.8398 0.4850 0.9030 0.9444 Columns 392 through 408 0.9762 0.0882 0.1124 0.6759 0.2658 0.9969 0.2109 0.4448 0.8444 0.2944 0.4496 0.8033 0.3102 0.7528 0.4726 0.8663 0.8036 Columns 409 through 425 0.4302 0.3275 0.9357 0.6515 0.8458 0.5180 0.1251 0.7099 0.6433 0.1486 0.5433 0.2169 0.7125 0.3834 0.8928 0.0299 0.6034 Columns 426 through 442 0.3349 0.6170 0.4512 0.0684 0.2755 0.6303 0.9988 0.7121 0.6772 0.5637 0.7432 0.5259 0.0968 0.0188 0.0551 0.4988 0.4829 Columns 443 through 459 0.1467 0.9799 0.5132 0.2050 0.1033 0.2027 0.9187 0.9750 0.4987 0.8068 0.3540 0.7409 0.3729 0.0596 0.1551 0.1418 0.9534 Columns 460 through 476 0.3202 0.6627 0.4256 0.4946 0.7941 0.1602 0.8176 0.4569 0.3788 0.1666 0.3160 0.9459 0.4406 0.4262 0.6813 0.1679 0.2677 Columns 477 through 493 0.8955 0.5651 0.9329 0.9894 0.8669 0.6379 0.5893 0.9716 0.6613 0.5445 0.6348 0.9017 0.9120 0.9313 0.5764 0.4490 0.1537 Columns 494 through 510 0.8011 0.6596 0.9358 0.1296 0.0565 0.3681 0.6727 0.1131 0.9024 0.5144 0.1420 0.8027 0.7433 0.6475 0.0018 0.7434 0.8937 Columns 511 through 527 0.9769 0.3792 0.7193 0.4281 0.3983 0.1927 0.8416 0.0943 0.0806 0.8415 0.1006 0.3081 0.5035 0.6444 0.1035 0.5914 0.8194 Columns 528 through 544 0.9185 0.5738 0.4580 0.2096 0.2330 0.2520 0.4248 0.4468 0.4914 0.1823 0.9253 0.3153 0.3101 0.4225 0.8742 0.3790 0.0204 Columns 545 through 561 0.8032 0.7744 0.2454 0.7979 0.6852 0.4355 0.5070 0.1437 0.0914 0.9140 0.9285 0.9269 0.2327 0.4292 0.7429 0.1743 0.0295 Columns 562 through 578 0.9824 0.7637 0.8844 0.2208 0.6235 0.3709 0.7979 0.0724 0.8241 0.8241 0.4795 0.1040 0.9501 0.6663 0.2202 0.9148 0.5927 Columns 579 through 595 0.8527 0.5249 0.7818 0.1769 0.4513 0.1121 0.6009 0.6659 0.5031 0.7726 0.0983 0.8659 0.3886 0.7202 0.0323 0.8836 0.3157 Columns 596 through 612 0.4977 0.4389 0.6322 0.1920 0.8882 0.8577 0.3930 0.8054 0.7729 0.7207 0.1854 0.3016 0.5350 0.7156 0.8306 0.9140 0.5015 Columns 613 through 629 0.5197 0.8213 0.3405 0.5517 0.7623 0.8903 0.8851 0.8861 0.6722 0.7718 0.4933 0.8627 0.0125 0.5017 0.1288 0.6592 0.5220 Columns 630 through 646 0.6141 0.0722 0.6356 0.1483 0.8008 0.6648 0.4920 0.4367 0.8929 0.2386 0.9713 0.0270 0.8829 0.8822 0.2060 0.8859 0.6835 Columns 647 through 663 0.3266 0.3122 0.6304 0.7868 0.3846 0.0959 0.1541 0.9968 0.5558 0.5685 0.6997 0.7461 0.8848 0.9495 0.8832 0.9120 0.4344 Columns 664 through 680 0.8049 0.2674 0.6442 0.9091 0.6147 0.3471 0.3525 0.3895 0.7362 0.0948 0.9089 0.3682 0.6921 0.3053 0.1118 0.2788 0.7921 Columns 681 through 697 0.8872 0.4355 0.8067 0.5407 0.4031 0.4234 0.0639 0.4319 0.7252 0.6950 0.1541 0.2985 0.9913 0.9585 0.0422 0.3990 0.6891 Columns 698 through 714 0.0016 0.1156 0.7249 0.9464 0.9474 0.4611 0.2107 0.2722 0.0120 0.1296 0.2020 0.1201 0.6449 0.1880 0.8459 0.7504 0.6405 Columns 715 through 731 0.7519 0.5118 0.6733 0.6370 0.4867 0.3107 0.6719 0.0855 0.7839 0.7257 0.7661 0.6230 0.2925 0.8563 0.4624 0.0309 0.3535 Columns 732 through 748 0.8062 0.4123 0.8096 0.8500 0.1517 0.4102 0.1069 0.2728 0.1229 0.9137 0.8064 0.9431 0.2617 0.1341 0.8338 0.2959 0.6149 Columns 749 through 765 0.0925 0.7096 0.5623 0.2879 0.0557 0.0827 0.5114 0.4475 0.2215 0.7202 0.1856 0.9754 0.1409 0.0614 0.0693 0.6066 0.9457 Columns 766 through 782 0.3326 0.9095 0.6793 0.2010 0.1727 0.1964 0.8003 0.0205 0.2607 0.6260 0.3517 0.8917 0.4015 0.1185 0.8021 0.7117 0.2035 Columns 783 through 799 0.2597 0.2913 0.0643 0.1026 0.6433 0.8012 0.8167 0.1839 0.4723 0.2086 0.5690 0.4331 0.0789 0.0654 0.7218 0.2611 0.8660 Columns 800 through 816 0.2332 0.5666 0.0020 0.0327 0.1520 0.5283 0.5171 0.5389 0.7042 0.5197 0.8659 0.9985 0.3188 0.7084 0.4772 0.3939 0.8459 Columns 817 through 833 0.5644 0.4279 0.0713 0.8294 0.6169 0.5415 0.3146 0.0544 0.9273 0.1957 0.4298 0.5437 0.3369 0.3556 0.1002 0.7759 0.6394 Columns 834 through 850 0.6921 0.4819 0.1866 0.2225 0.1297 0.1025 0.7388 0.9726 0.7471 0.9423 0.0893 0.3421 0.3435 0.7259 0.0268 0.5737 0.7024 Columns 851 through 867 0.3943 0.5021 0.2715...

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