If you describe a problem as simple, William, you'll invite close inspection.... Maybe you'll find a benefit in commenting the code in your next submission.
Touche! Yes, the new examples make the more extensive comments worthwhile.
Hello, margreet docter. Congratulations on solving the Problem. I hope you won't mind if I make a few observations. . . . (1) The function you have used on line 12 [the first line inside your loop] can also take two inputs. Have a look at the documentation for the function to see another syntax that would achieve the same thing. . . . (2) If you care about Cody "size", you could delete lines 14 & 19 in a resubmission, as they are only echoing values to the screen to assist in debugging. . . . (3) In this sort of problem, where a focus is on precision and decimal places, you might sometimes find it helpful to use the fprintf command to produce debugging output, with the syntax fprintf(formatSpec,A1,...,An), as this gives you more power to customise the format [e.g. scientific, or integer, or decimal; number of decimal places; etc.]. —DIV
Nice one :-)
Return the largest number that is adjacent to a zero
Swap the first and last columns
Number of toolboxes?
Return elements unique to either input
Even or Odd
Anyone for tennis? Your chances of winning a (standard) game
Make your own Test Suite (part 0)
What score did they give?
Comparison of floating-point numbers (singles)
The other half of the Fibonacci sequence
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office