C=
1 2 3 4 5 6 7 8
8 7 6 3 6 6 8 8
store the value in p,q
for first iteration p=1 and q=8
second iteration the p=2 and q=7
like this....upto 8 iterations.

 채택된 답변

sixwwwwww
sixwwwwww 2013년 10월 22일
편집: sixwwwwww 2013년 10월 22일

0 개 추천

you can do like this:
p = C(1,:)
q = C(2,:)
Or if you want to use for loop then you can do like this:
p = zeros(1, length(C));
q = zeros(1, length(C));
for i = 1:length(C)
p(i) = C(1, i);
q(i) = C(2, i);
end
disp(p)
disp(q)
I hope it helps. Good luck!

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2013년 10월 22일

댓글:

2013년 10월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by