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

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.

댓글을 달려면 로그인하십시오.

 채택된 답변

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

질문:

2016년 12월 8일

답변:

2016년 12월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by