split numbers into columns
Mostra commenti meno recenti
I have a column vector, A which is 1x1500, and each element in each row contains several variables in each element. I would like to split these into separate columns. In the columnvector each element has 15 numbers, like A(1,1)= 123456789123456. And what I would like to have is B1 = 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6.
Basically, I'm looking for a line of code which can add space between each number in the elements of my column vector. Anyone knows?
4 Commenti
"I have a column vector, A which is 1x1500"
If it has one row and 1500 columns that makes it a row vector.
"A(1,1)= 123456789123456"
You do not tell us anywhere what class the array has: is this a numeric array, or an cell array or character vectors, or something else? Your description is ambiguous, yet the answer you need will depend on the data type that you are working with.
Kerstin Olsson
il 4 Mag 2017
Kerstin Olsson
il 4 Mag 2017
Risposte (1)
Stephen23
il 4 Mag 2017
If the input is numeric, try this:
num = 123;
num2str(num)-'0'
1 Commento
ahcen aliouat
il 6 Ott 2020
thank you . that work perfectely!
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!