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

1 回表示 (過去 30 日間)
kitty varghese
kitty varghese 2018 年 3 月 12 日
コメント済み: kitty varghese 2018 年 3 月 12 日
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 件のコメント
Stephen23
Stephen23 2018 年 3 月 12 日
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 2018 年 3 月 12 日
Thank you Sir.

サインインしてコメントする。

採用された回答

Stephen23
Stephen23 2018 年 3 月 12 日
編集済み: Stephen23 2018 年 3 月 12 日
After the loop:
M = cell2mat(cellfun(@(m)m(:),I(:).','uni',0))

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by