Using for loop in matlab
2 views (last 30 days)
Show older comments
Hi everyone, I am assigning these values not in a very efficient way, can you suggest me how can i do it more efficiently? Thank you so much.
%Zone 1
absx(1,81)=0;
absy(1,81)=0;
absx(1,82)=0;
absy(1,82)=0;
absx(1,83)=450;
absy(1,83)=0;
absx(1,84)=450;
absy(1,84)=0;
absx(1,85)=450;
absy(1,85)=450;
absx(1,86)=450;
absy(1,86)=450;
absx(1,87)=0;
absy(1,87)=450;
absx(1,88)=0;
absy(1,88)=450;
%Zone 2
absx(1,89)=0;
absy(1,89)=900;
absx(1,90)=0;
absy(1,90)=900;
absx(1,91)=450;
absy(1,91)=900;
absx(1,92)=450;
absy(1,92)=900;
absx(1,93)=450;
absy(1,93)=1350;
absx(1,94)=450;
absy(1,94)=1350;
absx(1,95)=0;
absy(1,95)=1350;
absx(1,96)=0;
absy(1,96)=1350;
%Zone 3
absx(1,97)=900;
absy(1,97)=0;
absx(1,98)=900;
absy(1,98)=0;
absx(1,99)=900+450;
absy(1,99)=0;
absx(1,100)=900+450;
absy(1,100)=0;
absx(1,101)=900+450;
absy(1,101)=450;
absx(1,102)=900+450;
absy(1,102)=450;
absx(1,103)=900;
absy(1,103)=450;
absx(1,104)=900;
absy(1,104)=450;
%Zone 4
absx(1,105)=900;
absy(1,105)=900;
absx(1,106)=900;
absy(1,106)=900;
absx(1,107)=900+450;
absy(1,107)=900;
absx(1,108)=900+450;
absy(1,108)=900;
absx(1,109)=900+450;
absy(1,109)=900+450;
absx(1,110)=900+450;
absy(1,110)=900+450;
absx(1,111)=900;
absy(1,111)=1350;
absx(1,112)=900;
absy(1,112)=1350;
2 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Elementary Math 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!