num2str gives error as 'from struct to double conversion is not possible'

4 ビュー (過去 30 日間)
Selma Nur Keskin
Selma Nur Keskin 2020 年 7 月 8 日
編集済み: Selma Nur Keskin 2020 年 7 月 8 日
Hello everyone. I have a number of data files(pdbs) named as 1.pdb 2.pdb 3.pdb etc.. so I want to read all of them in a loop. Can someone explain why this does not work?
pdb= zeros;
for i=1:1000;
pdb(i,1) = pdbread([int2str(i) '.pdb']);
i=i+1;
end
it says 'Conversion to double from struct is not possible.'
thank you

採用された回答

madhan ravi
madhan ravi 2020 年 7 月 8 日
編集済み: madhan ravi 2020 年 7 月 8 日
pdb= cell(1e3, 1);
for ii = 1 : 1e3;
pdb{ii} = pdbread(sprintf('%d.pdb', ii));
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePower and Energy Systems についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by