Two matrix subtraction with each of different dimension

1 回表示 (過去 30 日間)
Pankaja Tanjore
Pankaja Tanjore 2015 年 2 月 19 日
コメント済み: Stephen23 2015 年 2 月 23 日
Hello,
I have two arrays , whose dimensions are different. for example : matrix A has the dimension 4x2
A=[1 4;
2 1;
3 1;
8 1];
and Matrix B has the dimension 5x2.
B=[1 6;
2 1;
2 5;
3 0;
8 1];
When i subtract these two matrcies using C=A-B i am getting the following error
"Matrix dimensions must agree"
So please let me know the function which hlps me to solve this problem Looking forward to hear from you .
Thanks Pankaja

回答 (1 件)

Mischa Kim
Mischa Kim 2015 年 2 月 19 日
Pankaja, in general, you can only subtract matrices of equal size. What would you like to see happening?
  1 件のコメント
Michael Haderlein
Michael Haderlein 2015 年 2 月 19 日
Still, it's not clear how this operation should look like. Can you show us what the result in your example should look like? Also, what do you mean with "edge coordinates of parallel lines"? Should the first column be the x values and the second column be the y values of the line? In this case, the coordinates totally don't describe straight lines but rather some curves.

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

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by