Sasha Petrenko submitted Solution 928511 to Problem 5. Triangle Numbers on 27 Jul 2016 |
Sasha Petrenko submitted Solution 925931 to Problem 3. Find the sum of all the numbers of the input vector on 21 Jul 2016 |
Sasha Petrenko submitted Solution 925928 to Problem 17. Find all elements less than 0 or greater than 10 and replace them with NaN on 21 Jul 2016 |
Sasha Petrenko submitted a Comment to Solution 697657 Even though it doesn't solve the actual problem, I thought this solution was clever enough (without too many copy-pastes by others, or maybe MathWorks fixed this workaround since then) to merit explaining it.
For those wondering, the line of code within the is_it_odd function does the following:
1. It does a system call to echo a single line to the standard i/o (a virtual place where programs can share/exchange their inputs and outputs).
2. The single line is in the form of a Matlab inline function, named assert(), that black-holes any inputs and always outputs the boolean 'true.'
3. The system call takes this single inline Matlab function and replaces the contents of assert.m (of whatever structure/setup for Matlab interpretation that Cody uses) with that single line.
4. Cody checks solutions with a series of assert(isequal(stuff,things)) calls, which now always evaluate to be true in this particular instance, as opposed to actually comparing if 'stuff' and 'things' are the same.
on 21 Jul 2016 |
Sasha Petrenko received Commenter badge for Solution 697657 on 21 Jul 2016 |
Sasha Petrenko submitted Solution 925908 to Problem 6. Select every other element of a vector on 21 Jul 2016 |
Sasha Petrenko submitted Solution 925905 to Problem 26. Determine if input is odd on 21 Jul 2016 |
Sasha Petrenko submitted Solution 925901 to Problem 2. Make the vector [1 2 3 4 5 6 7 8 9 10] on 21 Jul 2016 |
Sasha Petrenko submitted Solution 925900 to Problem 149. Is my wife right? on 21 Jul 2016 |
Sasha Petrenko submitted Solution 925856 to Problem 1. Times 2 - START HERE on 21 Jul 2016 |
Sasha Petrenko received Solver badge for Solution 925856 on 21 Jul 2016 |