Converting columns of strings into cells

Hello, I have a created an array of columns of strings and I want to convert this array into a cell array, where each cell contains indvidual strings. The name of array is proc_asm. In the screenshot you can see the individual strings, I want to put into cells as well as proc_asm' for better readability.
I generate the strings with a function and here is the code snippet where I do so:
S = [];
for str = node_list
%here I generate the strings for the array
s = generate_code1(graph(str{1}));
s = [s, ';'];
S = [S s]; %save the array
end
%modify array
[C, matches] = strsplit(str, ';');
proc_asm = fliplr(C);
codeidx = length(matches);
proc_asm'
end
I thought the easiest method would be to assign proc_asm' to a new cell array with the dimensions (length(matches), 1). But how can I define the individual cells?

1 commentaire

I tried to convert my generated strings into cells with:
s = cell(generate_code1(graph(str{1})));
But at this line I am getting an error that conversion from char to cell is not possible. I am confused with this error message, because I thought you can hold any types of variables in a cell, even other cells.

Connectez-vous pour commenter.

 Réponse acceptée

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by