|
From: | Brett Green |
Subject: | Re: Issue with the variable after exiting for loop |
Date: | Thu, 28 May 2020 18:35:34 -0400 |
Just for clarification, there are two ways to deal with it: either start at the end and work backwards (for i=sizeX:-1:1 ; for j=sizeY:-1:0 ; abc_p(i,j)=...; end; end or simply preallocate the last element abc_p(sizeX,sizeY)=1 before the loop (it will presumably be overwritten with the correct value later, but the array will be preallocated to full size).
[Prev in Thread] | Current Thread | [Next in Thread] |