Initiating a For Loop!
古いコメントを表示
CS 1371, the class for Matlab, has been fairly easy up to this week, but, for some reason, I do not understand iteration. My question is about For Loops. My code is supposed to run from the beginning of a vector to the end of a vector, using those values to index an array, but I can only get it to index the first value, and it is probably because I am not initiating my For Loop correctly. The variable "moves" is a 2Xn vector, and each column is used to find the value of that position in "map" I will post the relevant section of my code below:
n=[];
vec=moves(1,length(moves));
for arr=vec;
ogpos=moves(:,1);
ogposcat=ogpos';
movenext=(ogposcat(1),ogposcat(2));
movesnext= map(movenext);
end
I greatly appreciate any of your help!!!
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!