×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

mathcad and excel

mathcad and excel

mathcad and excel

(OP)
I have an excel file that has about 19 individual cells that I need to input to Mathcad.  The inputs are located in a single columen i.e B2, B4, B5, B9, etc.  I then need 13 outputs - the result of performing operations on these variables back into the same excel sheet at various cell locations in the same columne that the input came from i.e. B1, B3, B6, B10...

Mathcad 13's excel add in does this pretty neatly but you are limited to 10 inputs and 10 outputs per matchcad sheed inserted into the excel file.  I put several matchcad worksheets into the excel file in attempt to get the required inputs for a particular sheet down to 10.  Unfortunately I couldn't breakdown a couple of the mathcad worksheets below 11 inputs required.  I thought mathcads reference feature would get me around the 10 input/10 output limitation, but although you can reference a Mathcad worksheet that is live in excel and mathcad recognizes the variable names in the reference worksheet, it returns a value of zero in the referring sheet.  Referencing a Mathcad worksheet that is not live works fine.  I'm not real versed in Mathcad or excel so there may be a better way to do what I need.  Please advise.

RE: mathcad and excel

Use indirection.  Set up separate arrays elsewhere in your sheet or workbook so that both input and output arrays are contiguous and pass the arrays as single arrays.

TTFN



RE: mathcad and excel

(OP)
IRstuff, Is this what you mean?
 
Using the insert-data-file input to read a contiguous array I was able to select the excel tab the input range was on.  I then performed some simple operation on this input array in and tried to use the insert-data-file output function to output an array to a different place in the excel file.  The option to output to a different place in the excel files is not available. I can output to new file.  I suppose I could somehow read the new excel file back into the original but this seems a bit cumbersome.  Also it seems that excel needs to be closed for the read and write function to occur so it is not an interactive operation.

RE: mathcad and excel

No, I was thinking that you'd use a separate portion of the Excel spreadsheet to access all the inputs as a contiguous array.  Mathcad can then read it as a single vector.  It writes the results back to the Excel component as a single vector to another separate region on your sheet.  The original column then references the individual answers in the appropriate rows.  

An alternative is to read the entire column as a vector and use some clever indexing to access the input values.  Perform the operations, write the results into the complete array with some clever indexing or programming.  Write the entire array back into Excel

TTFN



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close