Info

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

setdiff with respect to column values

1 回表示 (過去 30 日間)
RDG
RDG 2013 年 8 月 21 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Suppose I have:
*A ={1 1 1
1 1 3
1 1 4
1 1 1
1 2 1
1 2 3
1 2 4};
B=1:6; %Lists the (complete) values for column 3 in A
  • I inserted a space in between row 4 and 5 for easier viewing.
How can I identify the missing values in column 3 (with respect to column 2)? The range of values of A(:,3) is given in B (From 1-6).
Output should be something similar to this:
C={1 1 2
1 1 5
1 1 6
1 2 2
1 2 5
1 2 6};
  2 件のコメント
Matt J
Matt J 2013 年 8 月 21 日
編集済み: Matt J 2013 年 8 月 21 日
It is not obvious what you consider "missing values" or how you obtained C from A. In particular, the values in C(:,3) are completely different than A(:,3).
dpb
dpb 2013 年 8 月 21 日
Indeed, a literal interpretation as I read it of OP's request would require a cell array and the missing values would look something like
{2:6;
[2 4:6;
[2 3 5 6;
... etc., ...
[1 3 5 6}

回答 (0 件)

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

Community Treasure Hunt

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

Start Hunting!

Translated by