Watch this Author's files
You have introduced a lot of unnecessary conversions in your code for converting from string to vector: This line suffices for doing the conversion: binVec = uint8(binStr) - uint8('0'); If you want a double vector, you can just do a double(binVec).
Contact us at files@mathworks.com