Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: remove recurring elements from cell.
Replies: 1   Last Post: Feb 24, 2013 9:23 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Kwesi Moore

Posts: 19
Registered: 11/27/09
remove recurring elements from cell.
Posted: Feb 23, 2013 4:34 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I need elements from the last cell (say k-th) not occurring in cell before it i.e. (k-1)th cell where k = 1,2,...,p. An example, k=2, r=2^(k+2)+2, n=2^(k)+1;

for i=1:k
dt = 1:2^i:n;
for j=1:2^(k-i)+1
cd(j,:)= dt+ r*(j-1);
end
dd{i}=cd;
end

dd{1} =[1 3 5; 11 13 15; 21 23 25]
dd{2} = [1 5;21 25]

I want all entries occurring in dd{2} removed from dd{1} i.e.

dd{1}= [3 11 13 15 23].
dd{2}= [1 5;21 25]



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.