store the value in the variable
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
sixwwwwww
2013-10-22
编辑:sixwwwwww
2013-10-22
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!
1 个评论
Image Analyst
2013-10-22
It's your homework and it's not that hard. Do you really need sixwwwwwwwww to do your homework for you? http://www.mathworks.com/matlabcentral/answers/8626-how-do-i-get-help-on-homework-questions-on-matlab-answers
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!