필터 지우기
필터 지우기

Repeat a string in multiple cells at once within an array

조회 수: 18 (최근 30일)
BobbyRoberts
BobbyRoberts 2020년 7월 3일
답변: madhan ravi 2020년 7월 3일
Hi. This is likely very simple, but I can't figure it out.
I'm trying to put a character string into a multiple cells in an array. As the code below shows, I am attempting to put 'value' in cells 1 to 5 in the first column of a cell array. But this way I'm writing it does not work. Thanks in advance.
curString = 'value'
data{[1:5],1} = strcat(curString)

답변 (1개)

madhan ravi
madhan ravi 2020년 7월 3일
clear data
curString = {'value'}
data(1:5,1) = curString

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by