Cody

# Problem 43737. Alternative Dimensions

Solution 1364317

Submitted on 1 Dec 2017 by David Verrelli
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   Pass
M=ones(3,3,3); M(2,:,:)=2.*M(2,:,:); M(3,:,:)=3.*M(3,:,:); ord = [3,2,1]; MC = ones(3,3,3); MC(:,:,2)=2.*MC(:,:,2); MC(:,:,3)=3.*MC(:,:,3); assert(isequal(transform(M,ord),MC))

y(:,:,1) = 1 1 1 1 1 1 1 1 1 y(:,:,2) = 2 2 2 2 2 2 2 2 2 y(:,:,3) = 3 3 3 3 3 3 3 3 3

2   Pass
M=rand(1,2,3,4,5,6); ord = [6 1 5 2 4 3]; assert(isequal(size(transform(M,ord)),ord))

y(:,:,1,1,1,1) = 0.9805 0.5042 0.9971 0.6886 0.7946 0.6411 y(:,:,2,1,1,1) = 0.6391 0.0263 0.9402 0.8613 0.7181 0.6500 y(:,:,3,1,1,1) = 0.4269 0.2082 0.0261 0.8146 0.7650 0.9393 y(:,:,4,1,1,1) = 0.3834 0.2488 0.0451 0.3023 0.9272 0.9757 y(:,:,5,1,1,1) = 0.4568 0.9757 0.8167 0.0901 0.9285 0.2115 y(:,:,1,2,1,1) = 0.5335 0.3300 0.5862 0.1285 0.0168 0.4073 y(:,:,2,2,1,1) = 0.7712 0.5548 0.9183 0.5468 0.0311 0.9811 y(:,:,3,2,1,1) = 0.1132 0.4469 0.9502 0.7538 0.2279 0.2134 y(:,:,4,2,1,1) = 0.2922 0.1879 0.8179 0.9709 0.2490 0.0987 y(:,:,5,2,1,1) = 0.6927 0.8171 0.9882 0.6412 0.4216 0.9550 y(:,:,1,1,2,1) = 0.4515 0.5555 0.1636 0.1135 0.6954 0.1475 y(:,:,2,1,2,1) = 0.4471 0.9024 0.0838 0.0148 0.7397 0.6782 y(:,:,3,1,2,1) = 0.7792 0.1504 0.5811 0.1996 0.9351 0.6996 y(:,:,4,1,2,1) = 0.7489 0.5294 0.8558 0.5632 0.1159 0.2007 y(:,:,5,1,2,1) = 0.6818 0.7380 0.6970 0.3178 0.7858 0.4638 y(:,:,1,2,2,1) = 0.6369 0.9534 0.3096 0.7882 0.6236 0.5854 y(:,:,2,2,2,1) = 0.5340 0.6422 0.6599 0.9169 0.6672 0.3153 y(:,:,3,2,2,1) = 0.2361 0.2022 0.9249 0.0918 0.7917 0.5990 y(:,:,4,2,2,1) = 0.5174 0.2652 0.5777 0.2642 0.1450 0.5705 y(:,:,5,2,2,1) = 0.0887 0.1252 0.7516 0.0063 0.9802 0.3502 y(:,:,1,1,3,1) = 0.6517 0.0559 0.4516 0.5506 0.4474 0.3226 y(:,:,2,1,3,1) = 0.3707 0.8057 0.6027 0.9311 0.8827 0.9319 y(:,:,3,1,3,1) = 0.9409 0.2419 0.6134 0.3141 0.1835 0.4601 y(:,:,4,1,3,1) = 0.7846 0.1433 0.6779 0.7014 0.2171 0.5007 y(:,:,5,1,3,1) = 0.6319 0.9655 0.3950 0.1863 0.0584 0.5891 y(:,:,1,2,3,1) = 0.8187 0.0597 0.2043 0.9500 0.2618 0.3394 y(:,:,2,2,3,1) = 0.6678 0.9172 0.3397 0.4189 0.8019 0.0159 y(:,:,3,2,3,1) = 0.8647 0.3769 0.7900 0.8102 0.9606 0.7512 y(:,:,4,2,3,1) = 0.0738 0.4764 0.0608 0.8207 0.1273 0.8920 y(:,:,5,2,3,1) = 0.3345 0.3700 0.3778 0.6028 0.6527 0.1012 y(:,:,1,1,4,1) = 0.0881 0.3020 0.0672 0.4365 0.1423 0.9916 y(:,:,2,1,4,1) = 0.3256 0.8712 0.1797 0.7863 0.0005 0.7535 y(:,:,3,1,4,1) = 0.2793 0.2953 0.4375 0.7984 0.9352 0.9610 y(:,:,4,1,4,1) = 0.0520 0.1570 0.8340 0.5528 0.9986 0.1188 y(:,:,5,1,4,1) = 0.3702 0.1667 0.1836 0.3892 0.6626 0.2022 y(:,:,1,2,4,1) = 0.3604 0.5911 0.8198 0.0324 0.1562 0.8125 y(:,:,2,2,4,1) = 0.6004 0.4649 0.5026 0.9062 0.9088 0.6324 y(:,:,3,2,4,1) = 0.0679 0.7955 0.8272 0.7553 0.8205 0.6577 y(:,:,4,2,4,1) = 0.1960 0.6125 0.7338 0.0111 0.9606 0.1154 y(:,:,5,2,4,1) = 0.9361 0.0060 0.6472 0.4593 0.0673 0.2531 y(:,:,1,1,1,2) = 0.1769 0.1679 0.5315 0.3611 0.0925 0.7492 y(:,:,2,1,1,2) = 0.5182 0.5638 0.4479 0.5964 0.1269 0.8287 y(:,:,3,1,1,2) = 0.6432 0.2241 0.2033 0.6256 0.8201 0.7161 y(:,:,4,1,1,2) = 0.4116 0.4401 0.0794 0.5633 0.8165 0.5918 y(:,:,5,1,1,2) = 0.8798 0.6065 0.4532 0.5839 0.7840 0.7614 y(:,:,1,2,1,2) = 0.9605 0.2317 0.6206 0.5761 0.1085 0.0298 y(:,:,2,2,1,2) = 0.1683 0.8022 0.4081 0.3036 0.9861 0.3764 y(:,:,3,2,1,2) = 0.9078 0.6683 0.9106 0.1230 0.5305 0.4993 y(:,:,4,2,1,2) = 0.7059 0.6011 0.5370 0.6222 0.8699 0.1813 y(:,:,5,2,1,2) = 0.4420 0.5808 0.7916 0.3136 0.9978 0.2171 y(:,:,1,1,2,2) = 0.0242 0.6392 0.7796 0.8920 0.9455 0.6336 y(:,:,2,1,2,2) = 0.4374 0.2512 0.8572 0.0084 0.2659 0.5447 y(:,:,3,1,2,2) = 0.8838 0.7329 0.6036 0.1025 0.4620 0.9602 y(:,:,4,1,2,2) = 0.2739 0.5802 0.4546 0.2157 0.4178 0.0888 y(:,:,5,1,2,2) = 0.6940 0.1480 0.8255 0.9123 0.6720 0.2409 y(:,:,1,2,2,2) = 0.5054 0.0387 0.2788 0.9880 0.0181 0.6843 y(:,:,2,2,2,2) = 0.6755 0.2528 0.6665 0.2160 0.9826 0.2708 y(:,:,3,2,2,2) = 0.7056 0.4447 0.9461 0.2149 0.4874 0.6967 y(:,:,4,2,2,2) = 0.8128 0.4719 0.1537 0.8587 0.5066 0.1304 y(:,:,5,2,2,2) = 0.9192 0.6424 0.7764 0.1222 0.4164 0.4870 y(:,:,1,1,3,2) = 0.3901 0.5597 0.1772 0.3993 0.8244 0.8048 y(:,:,2,1,3,2) = 0.5055 0.6252 0.5812 0.6306 0.6682 0.0619 y(:,:,3,1,3,2) = 0.2527 0.0060 0.9958 0.2303 0.6014 0.0684 y(:,:,4,1,3,2) = 0.3091 0.8910 0.5701 0.7659 0.0656 0.9474 y(:,:,5,1,3,2) = 0.4134 0.9101 0.4031 0.4440 0.8835 0.3961 y(:,:,1,2,3,2) = 0.2733 0.0428 0.9687 0.5702 0.4217 0.3672 y(:,:,2,2,3,2) = 0.1642 0.8083 0.7898 0.0591 0.4879 0.8754 y(:,:,3,2,3,2) = 0.7512 0.9035 0.7144 0.9116 0.1866 0.8666 y(:,:,4,2,3,2) = 0.4668 0.6952 0.7449 0.7343 0.3150 0.0274 y(:,:,5,2,3,2) = 0.9201 0.1821 0.5104 0.9384 0.5421 0.6812 y(:,:,1,1,4,2) = 0.3578 0.6716 0.5964 0.3510 0.5074 0.6672 y(:,:,2,1,4,2) = 0.6921 0.7297 0.1004 0.6729 0.3982 0.4104 y(:,:,3,1,4,2) = 0.8407 0.6305 0.6442 0.3422 0.6767 0.7825 y(:,:,4,1,4,2) = 0.0158 0.2068 0.4636 0.0310 0.2096 0.4031 y(:,:,5,1,4,2) = 0.5788 0.3027 0.6180 0.5111 0.0189 0.6511 y(:,:,1,2,4,2) = 0.1517 0.8048 0.8169 0.9132 0.1759 0.4529 y(:,:,2,2,4,2) = 0.8250 0.3387 0.0746 0.3055 0.8922 0.4287 y(:,:,3,2,4,2) = 0.3362 0.1593 0.2770 0.3497 0.5217 0.2450 y(:,:,4,2,4,2) = 0.3548 0.1112 0.9186 0.3027 0.6914 0.2685 y(:,:,5,2,4,2) = 0.8112 0.1535 0.6747 0.9671 0.9982 0.2663 y(:,:,1,1,1,3) = 0.1301 0.5620 0.6135 0.6063 0.0366 0.0660 y(:,:,2,1,1,3) = 0.3108 0.6865 0.8264 0.6777 0.8444 0.0090 y(:,:,3,1,1,3) = 0.8458 0.8030 0.1902 0.8339 0.8180 0.2285 y(:,:,4,1,1,3) = 0.6066 0.9658 0.6897 0.4735 0.4805 0.3505 y(:,:,5,1,1,3) = 0.4603 0.2597 0.7765 0.5522 0.8874 0.4598 y(:,:,1,2,1,3) = 0.2805 0.7616 0.5709 0.3608 0.7064 0.9908 y(:,:,2,2,1,3) = 0.5360 0.2572 0.3669 0.4119 0.2247 0.8366 y(:,:,3,2,1,3) = 0.9970 0.5090 0.3946 0.9232 0.5072 0.5346 y(:,:,4,2,1,3) = 0.1272 0.7981 0.3359 0.9228 0.5456 0.7786 y(:,:,5,2,1,3) = 0.9886 0.8694 0.3678 0.1903 0.0820 0.1468 y(:,:,1,1,2,3) = 0.0437 0.3963 0.8886 0.2458 0.9374 0.5869 y(:,:,2,1,2,3) = 0.7714 0.2087 0.5678 0.5422 0.1025 0.0494 y(:,:,3,1,2,3) = 0.9821 0.1413 0.1424 0.9122 0.2459 0.4412 y(:,:,4,1,2,3) = 0.3562 0.1340 0.9295 0.7374 0.3446 0.7516 y(:,:,5,1,2,3) = 0.5657 0.7234 0.4760 0.6489 0.2083 0.7669 y(:,:,1,2,2,3) = 0.9397 0.8031 0.2297 0.6892 0.8796 0.9954 y(:,:,2,2,2,3) = 0.9680 0.8499 0.3202 0.6716 0.3411 0.3861 y(:,:,3,2,2,3) = 0.4301 0.2985 0.9250 0.2042 0.9727 0.6341 y(:,:,4,2,2,3) = 0.7951 0.9912 0.6592 0.9193 0.4166 0.9079 y(:,:,5,2,2,3) = 0.0871 0.4985 0.3830 0.9967 0.4614 0.4361 y(:,:,1,1,3,3) = 0.1001 0.9078 0.3419 0.0251 0.4749 0.2340 y(:,:,2,1,3,3) = 0.0346 0.5457 0.6255 0.9498 0.8180 0.7796 y(:,:,3,1,3,3) = 0.0301 0.5490 0.6462 0.0099 0.1218 0.7396 y(:,:,4,1,3,3) = 0.6885 0.8823 0.6855 0.4992 0.0931 0.2779 y(:,:,5,1,3,3) = 0.8764 0.2115 0.8338 0.2346 0.6802 0.5806 y(:,:,1,2,3,3) = 0.4423 0.7907 0.2795 0.5274 0.2377 0.9119 y(:,:,2,2,3,3) = 0.6130 0.2507 0.2507 0.4228 0.8824 0.1445 y(:,:,3,2,3,3) = 0.1968 0.3935 0.3920 0.5140 0.8121 0.9045 y(:,:,4,2,3,3) = 0.4390 0.4947 0.7718 0.2768 0.2380 0.8959 y(:,:,5,2,3,3) = 0.4479 0.1744 0.7285 0.8908 0.6967 0.2822 y(:,:,1,1,4,3) = 0.6172 0.6115 0.7111 0.8968 0.8560 0.9008 y(:,:,2,1,4,3) = 0.7254 0.8968 0.6959 0.7238 0.8386 0.2769 y(:,:,3,1,4,3) = 0.9685 0.8694 0.9455 0.6218 0.8204 0.2659 y(:,:,4,1,4,3) = 0.3508 0.4663 0.1303 0.9431 0.9766 0.3757 y(:,:,5,1,4,3) = 0.5202 0.2723 0.3358 0.8039 0.8455 0.2276 y(:,:,1,2,4,3) = 0.8589 0.1039 0.5216 0.7023 0.1316 0.5357 y(:,:,2,2,4,3) = 0....