Effacer les filtres
Effacer les filtres

how to read and stack the details in columns from a cell array?

4 vues (au cours des 30 derniers jours)
kitty varghese
kitty varghese le 12 Mar 2018
Commenté : kitty varghese le 12 Mar 2018
I want to read and stack all the values present in cell into a column. Such that the values present in cell 1 is stacked onto column 1 and so on...
Here is the code of how I loaded it into cell.
dicomlist = dir(fullfile('C:\Users\kitty\Dropbox\denoise_ksvd\','ADNI','*.dcm'));
for cnt = 1 : numel(dicomlist)
I{cnt} = dicomread(fullfile('C:\Users\kitty\Dropbox\denoise_ksvd\','ADNI',dicomlist(cnt).name));
end
  2 commentaires
Stephen23
Stephen23 le 12 Mar 2018
Rather than repeating a hard-coded path, just define it once:
P = 'C:\Users\kitty\Dropbox\denoise_ksvd';
S = dir(fullfile(P,'ADNI','*.dcm'));
I = cell(1,numel(S));
for k = 1:numel(S)
I{k} = dicomread(fullfile(P,'ADNI',S(k).name));
end
kitty varghese
kitty varghese le 12 Mar 2018
Thank you Sir.

Connectez-vous pour commenter.

Réponse acceptée

Stephen23
Stephen23 le 12 Mar 2018
Modifié(e) : Stephen23 le 12 Mar 2018
After the loop:
M = cell2mat(cellfun(@(m)m(:),I(:).','uni',0))

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by