Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Iterate variables in vector 1

Status
Not open for further replies.

carbon787

Aerospace
Dec 9, 2010
1
Hello,
Are there any examples of including functions of several variables in a program to perform integrations over a vector? Maybe attachment can explain better. Can't get the program to iterate over different f(x) functions to perform the integration.

Thanks
 
Replies continue below

Recommended for you

The problem is the first line of the for loop

z <- z[k

Change z to any other letter and it executes. The trouble is that within the program, the first time the loop executes, it re-defines z as a scalar (equal to z[1 ). The second time through the loop it sees that z is a scalar (there is no z[2 within the scope of the program after the first loop) and hangs.

Peter
 
 http://files.engineering.com/getfile.aspx?folder=2cbe74a0-5bf1-4a5f-9136-a6704a4b9183&file=program_post_v2.xmcd
Status
Not open for further replies.

Part and Inventory Search

Sponsor