relative error of 2 matrix

3 ビュー (過去 30 日間)
amjad almaarafawi
amjad almaarafawi 2019 年 12 月 14 日
コメント済み: amjad almaarafawi 2019 年 12 月 14 日
A= matrix 20x2
V_interpolation = matrix 20x1
V_exper = -A(:,2);
r_exper = A(:,1);
Absuolut_Error = -abs(V_interpolation - V_exper);
Relative_Error = -abs(Absuolut_Error/(V_exper))
Im trying to ge the relative error for this data but I always get 20x20 matrix and not the right values. what am I doing wrog? thanks for your help in advance.
  2 件のコメント
dpb
dpb 2019 年 12 月 14 日
Relative_Error = -abs(Absuolut_Error/(V_exper))
"/" is matrix divide operator, not element-wise.
See
doc rdivide
for array division. The "dot" operators are universal for element-wise operations; the "plain" operators are matrix algebra versions.
amjad almaarafawi
amjad almaarafawi 2019 年 12 月 14 日
Thank you, thats work perfect.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by