how to take set difference keeping the number of rows and columns same.

1 view (last 30 days)
I have a matrix of 128*252 and second matrix of 128*21 .I want to take difference of these two matirx but in return i want 128*231 matrix ,but matlab gives me 29561*1 matrix. How to solve it? Any body please help its urgent.

Answers (1)

Walter Roberson
Walter Roberson on 24 May 2017
Consider that the set difference of [3 -7 18 3], against the empty set [], is [-7 3 18], with fewer entries in its representation, but [3 -7 18 4] against the empty set [] would be [-7 3 4 18] with the same number of entries. Therefore unless you happen to know some fairly strict properties on your matrices, the size of the set difference is not going to be predictable, and the result might or might not happen to have length divisible by the number of rows you have.
Perhaps you have some quite different idea of "set difference" in mind??


Find more on Operators and Elementary Operations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by