フィルターのクリア

Hi! Can anybody help me with my code?

1 回表示 (過去 30 日間)
Matty
Matty 2022 年 10 月 14 日
編集済み: Image Analyst 2022 年 10 月 14 日
mass_AnPoll = 0;
for i = 1:5
mass_AnPoll = mass_AnPoll + mer(1:i);
end
Error Message in Code: "Arrays have incompatible sizes for this operation."

採用された回答

Image Analyst
Image Analyst 2022 年 10 月 14 日
編集済み: Image Analyst 2022 年 10 月 14 日
size(mass_AnPoll)
size(mer)
Perhaps you want to append the elements
mass_AnPoll = 0;
for i = 1:5
mass_AnPoll = [mass_AnPoll, mer(1:i)]; % or [mass_AnPoll; mer(1:i)]
end
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

その他の回答 (1 件)

KSSV
KSSV 2022 年 10 月 14 日
mass_AnPoll = 0;
for i = 1:5
mass_AnPoll = mass_AnPoll + mer(1,i); % mer(1,i) this should be a single number of you index
end
You can simply also use:
mass_AnPoll = sum(mer(1,1:5))

カテゴリ

Help Center および File ExchangeEncryption / Cryptography についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by