I keep getting error "Error using / Matrix dimensions must agree."

回答 (1 件)

Stephen23
Stephen23 2014 年 10 月 7 日
編集済み: Stephen23 2014 年 10 月 7 日

1 投票

Try using element-wise rdivide (that dot is significant!):
./
Unless you really mean to use matrix division , in which case the problem lies somewhere else...
You can read about the concept of array v.s matrix operations here, along with a list of all functions that this applies to:

3 件のコメント

Nora
Nora 2014 年 10 月 7 日
doing that actually got me an answer, which is great, but i got 3 answers and i only want one so i dont think that is what i have to do. but thank you soo much for trying!
Nora
Nora 2014 年 10 月 7 日
i don't want matrix division though. just normal division
Stephen23
Stephen23 2014 年 10 月 7 日
編集済み: Stephen23 2014 年 10 月 7 日
You tried array division and state that this does not work (too many answers), and you also state that you do not want matrix division. So what exactly is "normal division" with regards to arrays? Please read that "array-vs-matrix-operations" page carefully, this is important to understand.
Your code is basically A/B , for some A and B that you calculate. Can you please print both A and B in MATLAB's command window and write another comment giving these arrays exactly as they appear in the command window. If they are too large, just give the sizes, please.

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

カテゴリ

タグ

質問済み:

2014 年 10 月 7 日

編集済み:

2014 年 10 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by