Skip to main content
1-Visitor
October 14, 2019
Question

Convert vector element into a scaler for evaluation in a while loop

  • October 14, 2019
  • 3 replies
  • 1500 views

Hi all,

I am attempting to extract a vector element piecewise within a while loop and assign it to the while evaluation variable for test.  I am able t do this once before I enter the loop but I cannot do this once in the loop and I get the "Array index is invalid message".  Is there a way to conveniently extract the element and assign it to the evaluation variable?  I am not a strong coder, clearly, I do not understand something.

Any help would be greatly appreciated.

 

3 replies

21-Topaz II
October 14, 2019

Hi, zero based array indexing is the default.  With one unknown only have columns 0 and 1

Capture.JPG

23-Emerald I
October 14, 2019

You have an undefined variable " n ".  You test for n>0, which fails so the Rkadapt never executes.

Annotation 2019-10-14 093117.jpg

25-Diamond I
October 14, 2019

@Fred_Kohlhepp wrote:

You have an undefined variable " n ". 


n is delivered as the first function argument.