Cody

# Problem 824. Set the array elements whose value is 13 to 0

Solution 1755726

Submitted on 20 Mar 2019 by Matt Offredi
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
A = [15 13 3]; y_correct = [15 0 3]; assert(isequal(your_fcn_name(A),y_correct)) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'for')),'for command is forbidden') assert(isempty(strfind(filetext, 'while')),'while command is forbidden') assert(isempty(strfind(filetext, 'find')),'find command is forbidden') assert(isempty(strfind(filetext, 'ind2sub')),'ind2sub command is forbidden')

L = 1×3 logical array 0 1 0 B = 15 0 3

2   Pass
A = 13; y_correct = 0; assert(isequal(your_fcn_name(A),y_correct)) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'for')),'for command is forbidden') assert(isempty(strfind(filetext, 'while')),'while command is forbidden') assert(isempty(strfind(filetext, 'find')),'find command is forbidden') assert(isempty(strfind(filetext, 'ind2sub')),'ind2sub command is forbidden')

L = logical 1 B = 0

3   Pass
A = []; y_correct = []; assert(isequal(your_fcn_name(A),y_correct)) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'for')),'for command is forbidden') assert(isempty(strfind(filetext, 'while')),'while command is forbidden') assert(isempty(strfind(filetext, 'find')),'find command is forbidden') assert(isempty(strfind(filetext, 'ind2sub')),'ind2sub command is forbidden')

L = 0×0 empty logical array B = []

4   Pass
A = [13 0 13; 13 13 8; 13 25 2]; titi = [0 0 0 ; 0 0 8;0 25 2]; assert(isequal(your_fcn_name(A),titi)) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'for')),'for command is forbidden') assert(isempty(strfind(filetext, 'while')),'while command is forbidden') assert(isempty(strfind(filetext, 'find')),'find command is forbidden') assert(isempty(strfind(filetext, 'ind2sub')),'ind2sub command is forbidden')

L = 3×3 logical array 1 0 1 1 1 0 1 0 0 B = 0 0 0 0 0 8 0 25 2

5   Pass
A=rand(10,10,10); A(1,2,2)=13; A(3,4,1)=13; A(5,6,3)=13; % what you cannot do but me I can ;) ! titi = A; I=find(titi==13); [u,v,w]=ind2sub(size(titi),I); for ii = 1 : numel(u) titi(u(ii),v(ii),w(ii))=0; end assert(isequal(your_fcn_name(A),titi)) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'for')),'for command is forbidden') assert(isempty(strfind(filetext, 'while')),'while command is forbidden') assert(isempty(strfind(filetext, 'find')),'find command is forbidden') assert(isempty(strfind(filetext, 'ind2sub')),'ind2sub command is forbidden')

10×10×10 logical array L(:,:,1) = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 L(:,:,2) = 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 L(:,:,3) = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 L(:,:,4) = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 L(:,:,10) = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 B(:,:,1) = 0.0878 0.5482 0.2834 0.7459 0.7277 0.2863 0.1403 0.5633 0.4779 0.1030 0.6157 0.4289 0.2839 0.9408 0.2132 0.8129 0.7793 0.7827 0.5716 0.5026 0.6314 0.7179 0.8681 0 0.2940 0.1209 0.6030 0.2298 0.0678 0.5931 0.3870 0.0158 0.3075 0.7586 0.6411 0.8582 0.8122 0.7233 0.0730 0.3031 0.6523 0.5648 0.9666 0.6910 0.3110 0.1491 0.3932 0.7656 0.0415 0.1710 0.4421 0.3663 0.1209 0.4656 0.0574 0.8557 0.8544 0.0059 0.4199 0.6611 0.8695 0.6939 0.6414 0.3573 0.8301 0.2066 0.7986 0.6713 0.3673 0.0347 0.5369 0.9684 0.1707 0.3194 0.3468 0.5009 0.9136 0.9648 0.1355 0.2815 0.5304 0.0649 0.5201 0.0329 0.5370 0.3552 0.6461 0.9112 0.1141 0.9817 0.8743 0.4389 0.2351 0.4979 0.4518 0.1754 0.8162 0.4301 0.8569 0.5697 B(:,:,2) = 0.4443 0 0.0059 0.4426 0.3362 0.4329 0.3123 0.8440 0.4278 0.9546 0.6242 0.5058 0.3534 0.9672 0.4162 0.9822 0.8995 0.6432 0.3744 0.2335 0.4136 0.4224 0.6779 0.4733 0.2200 0.5329 0.7263 0.0867 0.7593 0.0645 0.1732 0.0853 0.7416 0.2180 0.3973 0.6639 0.5271 0.3433 0.7517 0.5336 0.7970 0.6578 0.3900 0.2254 0.9854 0.6673 0.7718 0.0685 0.6282 0.8314 0.9608 0.2518 0.2204 0.4091 0.6847 0.3062 0.8072 0.1950 0.0278 0.3367 0.1796 0.1848 0.7174 0.6808 0.3399 0.2902 0.9093 0.0960 0.3524 0.7739 0.1319 0.1150 0.8215 0.1580 0.8720 0.7660 0.5599 0.1500 0.2295 0.3269 0.8907 0.3196 0.2275 0.6940 0.9680 0.7180 0.7607 0.9261 0.1541 0.9457 0.7413 0.5628 0.5510 0.9266 0.2794 0.5530 0.0965 0.5977 0.9225 0.7775 B(:,:,3) = 0.5069 0.0386 0.8930 0.9404 0.3890 0.5402 0.6779 0.0667 0.5572 0.3390 0.3115 0.6226 0.3963 0.6924 0.3991 0.9223 0.5658 0.2928 0.0429 0.0494 0.9502 0.7882 0.1577 0.4517 0.7013 0.3632 0.4173 0.2926 0.6790 0.6067 0.7465 0.0279 0.8986 0.4393 0.8613 0.5237 0.5338 0.4246 0.4492 0.3920 0.5440 0.6780 0.1885 0.9166 0.9365 0 0.6521 0.8803 0.5718 0.7426 0.9597 0.1614 0.9442 0.9174 0.2245 0.4681 0.1147 0.7676 0.3823 0.7105 0.1685 0.5228 0.3637 0.3814 0.5006 0.0911 0.0017 0.1877 0.7742 0.4622 0.6542 0.0416 0.5228 0.2859 0.7131 0.5051 0.1823 0.7612 0.6935 0.6660 0.4699 0.5405 0.3615 0.4954 0.4729 0.1887 0.3712 0.0243 0.0863 0.2315 0.2007 0.1711 0.5200 0.6455 0.1117 0.4731 0.3462 0.4729 0.5566 0.9420 B(:,:,4) = 0.6772 0.0966 0.5246 0.9279 0.8636 0.7265 0.6074 0.9457 0.2587 0.7811 0.5227 0.1466 0.9660 0.2402 0.4425 0.8195 0.3197 0.5589 0.8539 0.6967 0.5597 0.0003 0.5472 0.0933 0.7904 0.9979 0.5175 0.5634 0.5617 0.5989 0.8726 0.9932 0.5874 0.7966 0.7548 0.9632 0.7794 0.7412 0.7605 0.8341 0.8754 0.0164 0.6321 0.6473 0.4585 0.8272 0.1336 0.1790 0.6219 0.5042 0.1817 0.2184 0.9054 0.4283 0.7496 0.7036 0.4059 0.4525 0.6658 0.7910 0.5932 1.0000 0.0795 0.1074 0.7388 0.6676 0.9126 0.7044 0.2983 0.6091 0.9368 0.6788 0.1326 0.5276 0.6724 0.7436 0.4012 0.7390 0.8751 0.5153 0.7451 0.6268 0.4764 0.8795 0.0807 0.2533 0.6239 0.0523 0.9892 0.2489 0.7005 0.0355 0.8695 0.2603 0.8179 0.6762 0.2250 0.0463 0.3304 0.1722 B(:,:,5) = 0.8685 0.0842 0.2055 0.8418 0.2425 0.3095 0.5639 0.2816 0.6390 0.6188 0.7777 0.6662 0.3675 0.0449 0.5077 0.7148 0.3228 0.3083 0.7213 0.4001 0.2228 0.1327 0.1258 0.7093 0.1543 0.9783 0.2911 0.9642 0.1262 0.3280 0.4016 0.7821 0.1461 0.9973 0.3676 0.6159 0.4953 0.0726 0.0563 0.8382 0.1630 0.7520 0.7715 0.3523 0.6167 0.1098 0.9385 0.2482 0.3136 0.9693 0.3582 0.1605 0.0825 0.7449 0.3447 0.6650 0.5805 0.0979 0.9703 0.8701 0.4447 0.6276 0.0264 0.2298 0.9033 0.5366 0.6586 0.0668 0.9002 0.9226 0.2982 0.2333 0.0518 0.7472 0.4921 0.3578 0.5411 0.0994 0.2306 0.7193 0.2349 0.9375 0.4859 0.1524 0.9447 0.7248 0.9000 0.8868 0.3335 0.6136 0.6179 0.6956 0.0239 0.4795 0.4423 0.0446 0.4166 0.1272 0.1781 0.5958 B(:,:,6) = 0.2606 0.9958 0.1324 0.8668 0.3493 0.2723 0.4649 0.1165 0.4724 0.5594 0.2247 0.6357 0.9796 0.8134 0.8601 0.7931 0.3111 0.7287 0.1349 0.0835 0.9209 0.9306 0.7491 0.0512 0.7927 0.9823 0.1548 0.0248 0.3887 0.9400 0.4334 0.4009 0.1586 0.1060 0.1338 0.1484 0.1180 0.6522 0.4988 0.4048 0.5825 0.0150 0.6950 0.1903 0.9006 0.7522 0.6625 0.0189 0.4810 0.1317 0.5554 0.2410 0.2780 0.4062 0.4128 0.6514 0.8844 0.8170 0.9704 0.27...

6   Pass
A = repmat(13,89,17); assert(isequal(your_fcn_name(A),repmat(0,89,17))) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'for')),'for command is forbidden') assert(isempty(strfind(filetext, 'while')),'while command is forbidden') assert(isempty(strfind(filetext, 'find')),'find command is forbidden') assert(isempty(strfind(filetext, 'ind2sub')),'ind2sub command is forbidden')

L = 89×17 logical array 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

7   Pass
A= magic(5); B =A; B(3,3) = 0 assert(isequal(your_fcn_name(A),B)) filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'for')),'for command is forbidden') assert(isempty(strfind(filetext, 'while')),'while command is forbidden') assert(isempty(strfind(filetext, 'find')),'find command is forbidden') assert(isempty(strfind(filetext, 'ind2sub')),'ind2sub command is forbidden')

B = 17 24 1 8 15 23 5 7 14 16 4 6 0 20 22 10 12 19 21 3 11 18 25 2 9 L = 5×5 logical array 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 B = 17 24 1 8 15 23 5 7 14 16 4 6 0 20 22 10 12 19 21 3 11 18 25 2 9

8   Pass
A= 13.3; B = A; assert(isequal(your_fcn_name(A),B))

L = logical 0 B = 13.3000

### Community Treasure Hunt

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

Start Hunting!