Hey all, I'm working on a school project that's about changing the order of characters in a binary array. In the process of writing it, I found a bit of code online to help me:
v = sprintf('%d', array3)
endarray = v - '0'
Basically, what this does is it takes the value of array3, which for example is  and creates a variable endarray, which in turn becomes [1 0 1 1 0 1 0]. When I implemented this piece of code I didn't quite know how it functioned, and it wasn't explained on the page where I found it, so I decided to go back to it later. Unfortunately I still haven't figured it out. I can't wrap my head around the combinations of sprintf, %d, and the -'0'.
Any help with understanding these two lines would be greatly appreciated.