convert string to cell array
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
chlor thanks
el 1 de Jul. de 2016
Comentada: Walter Roberson
el 5 de Jul. de 2016
I have a for loop that gives results that are constantly updating
x= 'A'
x= 'B'
x= 'C'
But I would like to convert that into x= {'A', 'B', 'C'}
Any Suggestions?
0 comentarios
Respuesta aceptada
Thorsten
el 1 de Jul. de 2016
clear x
x{1} = 'A';
x{end+2} = 'B';
x{end+3} = 'C';
and so on
4 comentarios
Walter Roberson
el 5 de Jul. de 2016
numfiles = 0;
for k = 1 : numFolders
SubFolder = listOfFolderNames{k};
filePattern = fullfile(SubFolder, '*.xls*');
ExcelFiles = dir(filePattern);
if ~isempty(ExcelFiles)
for k2 = 1 : length(ExcelFiles)
numfiles = numfiles + 1;
AllExcel{numfiles} = fullfile(SubFolder, ExcelFiles(k2).name);
end
end
end
However, what I would do instead is look in the File Exchange for https://www.mathworks.com/matlabcentral/fileexchange/19550-recursive-directory-listing or https://www.mathworks.com/matlabcentral/fileexchange/32226-recursive-directory-listing-enhanced-rdir
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Type Conversion en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!