Info

この質問は閉じられています。 編集または回答するには再度開いてください。

IMAGE Processing(matrix comparision)

1 回表示 (過去 30 日間)
Muthuraj V
Muthuraj V 2011 年 12 月 16 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi All,
if i have two matrix to be compared, and i dont want perticular element to be compaered, how do i do that in matlab..??
for Ex
A=[1 8 8
7 6 *
9 9 9]
B=[3 5 6
5 6 5
9 0 9]
as u can see a '*' symbol in matrix a, so while comparing A and B i dont want to compare the element at the '*' postion in A, with the corrosponding B's element..
please help me in this regard,
Thank You in advance.
[EDITED: Code formatted, Jan Simon]
  2 件のコメント
Chandra Kurniawan
Chandra Kurniawan 2011 年 12 月 16 日
Actually, you cannot put '*' in numeric array.
You can use other array to define the position of '*'
Eq :
pos = [2 3];
Muthuraj V
Muthuraj V 2011 年 12 月 22 日
i think u dint get my question,,,,
i have put a '*' to indicate that it can be any value....
when checking for equality between two Matrix, i don't want to check the equality of a particular element in the matrix,
say for example i dont want to compare the element in the index or position(0,2) with other matrix, so how do i do this..??

回答 (1 件)

Jan
Jan 2011 年 12 月 16 日
What exactly does "compare" mean? It would be easier to create an answer, if this detail need not to be guessed.
Perhaps:
mask = logical([1, 1, 1; 1, 1, 0; 1, 1, 1]);
isequal(A(mask), B(mask))
  5 件のコメント
Walter Roberson
Walter Roberson 2011 年 12 月 27 日
http://www.mathworks.com/help/techdoc/math/f1-85462.html#bq7egb6-1
Muthuraj V
Muthuraj V 2011 年 12 月 30 日
Thanks a Lot...

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by