subtraction bwtween rows of a field

1 回表示 (過去 30 日間)
Selma Nur Keskin
Selma Nur Keskin 2020 年 7 月 13 日
コメント済み: Selma Nur Keskin 2020 年 7 月 13 日
I have a very simple code as following
for i=1:100
datafiles{i}= load(sprintf('%d.mat', i));
for k=1:611
bond_vec(k,:)=datafiles{i}(1).xyz(k+1,:) - datafiles{i}(1).xyz(k,:);
end
bond_vectors{i}=(bond_vec);
end
yet it gives error as if sizes do not compare. I can't see what the problem is can anyone help? thanks
Unable to perform assignment because the size of the left side is 1-by-2 and the size of the right side is 1-by-3.

採用された回答

madhan ravi
madhan ravi 2020 年 7 月 13 日
Before all the loops
bond_vec = cell(100, 611);
Inside the second loop
bond_vec{ii, k} = ... rest remains unchanged
Remove
bond_vectors{i}=(bond_vec);
  1 件のコメント
Selma Nur Keskin
Selma Nur Keskin 2020 年 7 月 13 日
thanks sir!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by