How to overcome this problem; Error using - Matrix dimensions must agree.

1 回表示 (過去 30 日間)
Abba Alhaji Bala
Abba Alhaji Bala 2019 年 8 月 5 日
コメント済み: KSSV 2019 年 8 月 6 日
Hello guys! please i need your input. i wanted to calculate an error using this equation
En =sqrt(((psi-p)^2)/psi^2); with psi having 108x108 double and p having 101x136 double dimensions. the error using - matrix dimesions must agree keep pupping.
i knew the two are of different dimensions, but i think if i use interpolation it will increase the error too. please is there any alternative method to make such calculation?

採用された回答

KSSV
KSSV 2019 年 8 月 5 日
Two options:
Reduce dimensions
psi = psi(1:101,1:108) ;
p = p(1:101,1:108) ;
En =sqrt(((psi-p)^2)/psi^2);
Do interpolation
  3 件のコメント
Abba Alhaji Bala
Abba Alhaji Bala 2019 年 8 月 5 日
The first one worked but yet recieved another issue after running "Warning: Rank deficient, rank = 3, tol = 6.803137e-17. " and instead of a single value of En it came as a 101x101 complex
KSSV
KSSV 2019 年 8 月 6 日
En =sqrt(((psi-p).^2)./psi.^2);

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by