Repeat a string in multiple cells at once within an array

19 visualizaciones (últimos 30 días)
BobbyRoberts
BobbyRoberts el 3 de Jul. de 2020
Respondida: madhan ravi el 3 de Jul. de 2020
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)

Respuestas (1)

madhan ravi
madhan ravi el 3 de Jul. de 2020
clear data
curString = {'value'}
data(1:5,1) = curString

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by