Could anyone help me how to store the result together in single matrix.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
jaah navi
am 19 Sep. 2019
Kommentiert: jaah navi
am 19 Sep. 2019
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 Kommentare
Akzeptierte Antwort
Adam
am 19 Sep. 2019
Making minimal changes to your 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)
BB(i,:) = [bb,bbb]
end
though it could be made neater.
It would be good if you didn't keep opening questions to ask the same thing many times. Sooner or later people will just stop answering at all.
2 Kommentare
Rik
am 19 Sep. 2019
I'm already at the point I only open some of the questions. Judging by whose comments/answers I see I'm not the only one.
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!