Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Multiple outputs from nested loops

Status
Not open for further replies.

lmenich

Structural
Apr 29, 2008
14
CA
I have a relatively long programming function containing nested loops and am trying to retrieve more than one output from them. Is there a way I can assign a value within a function as a global variable? Or return more than one output using some other method?

Thanks
 
Replies continue below

Recommended for you

The output of a program can be a matrix. 'Augment' and 'stack' are two commands to get familiar with. For instance, to return multiple vectors from a program you can use the augment command to create one matrix.

output <- augment(vector1, vector2...)

Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top