making continual statement(?) without typing entire elements

X,Y,Z are data,
a,b,c,n are numbers (a+b+c=n),
X is 5xa double, Y is 5x(b+c) double, and Z is 1xn double data.
-
How can I make this without typing entire elements?
A = find(X(:,1)==Z(1) & X(:,2)==Z(2) & ... & X(:,a)==Z(a)) &
... Y(:,b)==Z(a+1) & Y(:,b+1)==Z(a+2) & ... & Y(:,b+c)==Z(n));
Many thanks to all!

 採用された回答

Steven Lord
Steven Lord 2018 年 7 月 31 日

1 投票

Transpose X and Y then use the ismember or ismembertol functions.

その他の回答 (0 件)

カテゴリ

質問済み:

W K
2018 年 7 月 31 日

回答済み:

2018 年 7 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by