Skip to main content
1-Visitor
January 20, 2015
Question

Some help needed with for loop.

  • January 20, 2015
  • 3 replies
  • 1023 views

I have been working on this for sometime now.

I have a for loop that I want to calculate and make diagrams of.

My problem is that how can I get all of the steps in the for loop?

See file attached.

I have been trying to find help from here and from other sources, but I still can't find a way to print/plot the steps.

I have heard that I should have used a other software to do this simulation but I wanted to work with this software.

THX in advance for the help. Lauri

3 replies

12-Amethyst
January 20, 2015

Does the attached help?

You don't want the "[i" in the output array this will only give the last value for each of your variables (?)

Assigning the output of the program then allows the data calculated to be accesible to mathcad.

I'm not sure what you want to plot , so if you have further questions you will need to re-post.

Regards

Andy

25-Diamond I
January 20, 2015

The attached file should help

19-Tanzanite
January 20, 2015

You need to change the last line of the program to this:

augment.png

You will then get an error, because in the program you have mixed literal and vector subscripts where you want vector subscripts. For example, the assignment of alpha0 and X0. Also the assignment of Xi+1 based on Xi. many others too. You need to track all of these down and change the literal subscript to a vector subscript. Then each of the variables is a vector (of the same length), and augment will convert them to the columns of a matrix.