Change cell object to char
이전 댓글 표시
How can I convert the name object to be a char instead of a cell?
Thank you very much.
Emily
답변 (1개)
a={'abc'}
whos a
b=char(a)
whos b
댓글 수: 4
Emily Doherty
2022년 11월 3일
Joseph Mah
2022년 11월 3일
You could just set a=char(a) if your goal is to make a char instead of a cell array, though will not work if you have multiple cells in your cell array. In that case maybe look into string arrays.
Emily Doherty
2022년 11월 3일
Fangjun Jiang
2022년 11월 3일
Might it be that this field 'name' in that nested structure requires a cell of string?
try
SubjStats(1, 1).basis.stim.values{1, 1}.name='abc'
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!