-
5 Comments
Can someone explain to me how this function works (even if it is a trick)? I'm trying to parse through the code, but how it works isn't clear to me.
the sparse function places the values (third input) into the row and column specified, 1st and second inputs respectively. if there are any overlapping coordinates then it sums them, so I created a matrix that, when fed into sparse, would sum the rows, sum the columns, and sum the diagonals in each direction. Then I Cody-fied it (teehee) by changing these indices into a string of characters, which Cody sizes as small, and subtracting a base character from it. does that make sense now?
it might make more sense to look at one of my other solutions that uses the str2num function instead of the letter thing...
Suggested Problems
-
1027 Solvers
-
Back to basics 4 - Search Path
370 Solvers
-
Calculate the area of a triangle between three points
3144 Solvers
-
Generate N equally spaced intervals between -L and L
880 Solvers
-
526 Solvers
More from this Author5
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!