I have a script in which a string of number is entered
string='123'
or
string='9823'
I am trying to convert this into an array of the form [a,b,c,d] e.g from a string of '123' to a numerical array [1,2,3]
Any tips on how to do this?
str = '123';
num = str - '0';
% num = [1 2 3];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With