cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

problem plotting data derived in a nested FOR Loop

Gravel

problem plotting data derived in a nested FOR Loop

Hi,

I have a problem plotting some data generated in a matrix derived from a nested FOR loop. I seem to have lots of problems with nested loops. The calculation proceedure is calculating fatigue crack growth from an initial crack size (depth = a and length = 2c) when exposed to stress levels applied a number of times in a block (day). The output matrix X looks to have the right data in columns but this does not seem to plot correctly?

Is there a problem with the FOR loop logic/syntax or the way I am calling the data up for the plot?

Any assistance would be appreciated.

Thanks

ross

5 REPLIES 5

Re: problem plotting data derived in a nested FOR Loop

You haven't defined j outside of the program that calculates X. You need to set j:=0..last(cycles). However, I can't really test this as you haven't supplied files "cycles.txt", "comp1membrane.txt", "comp1bending.txt".

Alan

Re: problem plotting data derived in a nested FOR Loop

Alan,

I am amazed and grateful at your enthusiasm to help out.

I have attached the 3 input files and would appreciate if you can find a problem.

Cheers

ross

Re: problem plotting data derived in a nested FOR Loop

Now with attachments.

Thanks

Ross

Re: problem plotting data derived in a nested FOR Loop

Is this what you were expecting to see?

BS.PNG

Alan

Re: problem plotting data derived in a nested FOR Loop

Alan,

Yep it is! I have used similar syntax previously but there is obviously some subtle problem with this latest effort. One again I am indebted to you for the correction. It is frustratingly simple!

Cheers and have a good day.

Ross