why matlab always show my equation as matrix dimension

3 ビュー (過去 30 日間)
Hao Ming Low
Hao Ming Low 2020 年 3 月 24 日
回答済み: Stephen23 2020 年 3 月 24 日
i have tried to input the equation
y = (668.061/x)*[-39-e^(-0.1468*x)]
, but it always says that
Error using ^ (line 51)
Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a
scalar. To perform elementwise matrix powers, use '.^'.

回答 (2 件)

Birdman
Birdman 2020 年 3 月 24 日
Try this:
y = (668.061./x)*[-39-exp(-0.1468*x)]

Stephen23
Stephen23 2020 年 3 月 24 日
Most likely you need to follow the advice given in the error message and use array operations, e.g.:
y = (668.061./x).*(-39-exp(-0.1468*x))
"why matlab always show my equation as matrix dimension"
Because you used the wrong operators:

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by