フィルターのクリア

What does this error mean?

1 回表示 (過去 30 日間)
Kathleen
Kathleen 2023 年 12 月 5 日
回答済み: Image Analyst 2023 年 12 月 5 日
Unable to perform assignment because the left and right sides have a different number of elements.
Error in lab26_kpetting (line 46)
acc(idx) = (px(idx)-Ffriction)/mass;

回答 (1 件)

Image Analyst
Image Analyst 2023 年 12 月 5 日
If idx is a single number, then acc(idx) needs to be a single number. Evidently something in your expression is an array. Try this:
idx
size(idx)
size(px(idx))
size(Ffriction)
size(mass)
What do you see? One of them does not have a size of 1. It's not a scalar. One of them is an array with multiple elements.
Or else Ffriction doesn't have the same number of elements as idx.

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by