Could anyone help me how to store the result together in single matrix.
Show older comments
code:
B=[1 2;
1 3;
2 5;
2 4;
3 5;
4 6;
4 5]
for i=1:7
bbb= 1:6;
bb= B(i,1:2)
bbb= setdiff(bbb,bb)
result= [bb,bbb]
end
the above code executes and gives the result ,but i need to store all the result together in one matrix.Could anyone please help me on it.
3 Comments
Ankit
on 19 Sep 2019
B=[1 2;
1 3;
2 5;
2 4;
3 5;
4 6;
4 5]
for i=1:7
bbb= 1:6;
res.bb= B(i,1:2)
res.bbb= setdiff(bbb,bb)
res.result= [bb,bbb]
end
you can save as structure into workspace. Are you looking something similar?
Rik
on 19 Sep 2019
@Ankit, note that your code overwrites the result every iteration.
Ankit
on 19 Sep 2019
@rik yes I didnt notice that thanks for pointing out!
Accepted Answer
More Answers (0)
Categories
Find more on Random Number Generators 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!