combining excel and mathcad
combining excel and mathcad
(OP)
Can someone help me to learn how to combine excel and mathcad? It should be simplied as possible. It would also help if you give an exemple.
thanks
thanks
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join EngTips Forums!
*EngTips's functionality depends on members receiving email. By joining you are opting in to receive email. Posting Guidelines 

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 EngTips Forums:
Register now while it's still free!
Already a member? Close this window and log in.
RE: combining excel and mathcad
TTFN
RE: combining excel and mathcad
You can:
Import/Export arrays and matrix data to/from an Excel file via the Insert>Component...>File Read or Write.
Insert an Excel object into the current Mathcad worksheet.
Insert>Component>Excel. You define input/output cells and can use all of the functions that Excel provides.
Insert 3D Mathcad graphs into an Excel sheet. You need to download the Mathcad AddIn for Microsoft Excel at http://www.msmiami.com/download.cfm?categoryid=0. (Direct link http://www.msmiami.com/custom/downloads/xlaAddIn.exe)
This is a very nice feature and I have used it quite a bit.
If anyone else knows other ways to interface Mathcad and Excel please comment on this!
Hope this helps!
Matt
RE: combining excel and mathcad
Import/Export arrays and matrix data to/from an Excel file via the Insert>Component...>File Read or Write.
I want to take the values I have in excel and apply into the equations in mathcad
RE: combining excel and mathcad
In Mathcad, just go to Insert>Component... and select "File Read or Write" in the dialog box.
Then, make sure the "Read from a file" radio button is highlighted on the next screen.
Under the next screen, select "Excel" from the File Type dropdown, choose your saved Excel file with the Browse... button.
Click Ok and Mathcad inserts a File Read component into your worksheet. See how the component is on the right side of the := assigment operator? Now all you do is tell Mathcad what variable to place the data from your Excel sheet into. Just for simplicity, type in "A" into the variable placeholder. If the component turns red with an error you should go back and make sure that the file you specified actually exists.
Then type "A=" to dump what is in A to the screen. You should see all of the data from your Excel file in the A matrix!
From there, you can access the data in A just like you would any other matrix.
For example, if you want to store only the 3rd column to B, you'd type:
B:A(Ctrl6)2
(2 is the column number, because the columns are numbered 0,1,2, etc.) Ctrl6 makes a Matrix Column operator and can also be found in the Matrix toolbar
If you want to store only the 3rd row to C, you'd type:
C:A(Ctrl1)(Ctrl6)2
Ctrl1 is the Matrix transpose operator flips the matrix along its diagonal so all the rows become columns and all the columns become rows. It shows up as a superscript T. The the Matrix Column extracts off the 3rd column (formerly the 3rd row befor the transpose) and puts it in C.
If you just want a single number from A, just type:
A[r,c=
Where r and c are the row and column indeces of the number you want.
Now, lets say that you have a formula f(x,y) and your A matrix contains two columns corresponding of values of x and y, and you want to evaluate this function for all of values of x and y in your Excel sheet.
Make a range variable that starts at 0 and goes until how many rows you have. Remember that the value of the index is always one less since it starts at 0.
i:0,1;rows(A)1
As our test function let's find the distance of an (x,y) pair to the origin.
f(x,y):\x^2 +y^2
(Translation: f(x,y)=sqrt(x^2+y^2)
We'll make a column vector called d which contains the distance of each (x,y) pair
x:A(Ctrl6)0
y:A(Ctrl6)1
d[i:f(x[i,y[i)
And there you go! First we extracted the columns of A into x and y, and then we used the subscript operator with a range variable to store the results of the function. Type "d=" to see the answers.
Hope this has helps!
Matt
RE: combining excel and mathcad
For exemple:
I want to take all the values in a column(B) and apply it in my equation which is
molesx:=constants*(columnB) How to I do that?
another question: Can I more than one column with defferent values into the same equation and get different values molesx for each column. For ex.
molesx:=constants*(column1,column2....)
get molesx for column1 moles for column2 and so on
RE: combining excel and mathcad
Try going to View>Toolbars>Matrix to get access to all of the matrix functions. When I said (Ctrl6) that is the M^<> thingee. The (Ctrl1) is the M^T button. I just told you the keystroke shortcuts instead of how to get them from the toolbar. :) (I know you probably know this, but just to cover all the bases, when I said (Ctrl1) that means to hold down the Ctrl key and press the 1 key at the same time.)
As for the matrix operators, just check out the help files on them. Look up "matrix operations".
Matt
RE: combining excel and mathcad
Brilliant! I just came up on the same exact problem, and wondered how I was going to figure this one out!
Many thanks for your advice!
Regards,
Grant
Aerospace Engineer
RE: combining excel and mathcad
Bung
Life is nonlinear...
RE: combining excel and mathcad
http://www.mathcad.com/download/download.asp
TTFN
RE: combining excel and mathcad
I've already got an Excel spreadsheet object sitting in MathCAD V.11. I need to feed it variable data from the surrounding MathCAD sheet, and later on pull data from it back into the MathCAD sheet.
Unless the above stuff works (and due to the apparent need for an external file reference, I think it may not), what does?
Thanks in advance!
Steve Sywak
RE: combining excel and mathcad
When you insert the Excel object, it's normally defaulted to 1 input variable and 1 output variable.
TTFN
RE: combining excel and mathcad
Thanks for the quick response.
I'm using "someone else's" MathCAD file, so how it was started up is out of my control.
1) Yes, the embedded Excel object is NOT an external reference. If it were, it would probably make my life a whole lot easier. It does contain equations, and so is far more useful than just a means to store an array of data. Being able to do this actually makes MathCAD a far more appealing package.
2) What I need to do is something like this
A:=15.5
PUSH(Embedded_Spreadsheet_X,Row,Column)=A
D=PULL(Embedded_Spreadsheet_X,Row,Column)
Where I can push a variable into a cell in the embedded spreadsheet, and pull a result back into a variable for MathCAD (proper) to use.
And I want to keep the embedded spreadsheet present in the MathCAD sheet so that both when I save it, and when I print it out for my project records, the data is all together.
Can it be done?
RE: combining excel and mathcad
If you put the edit cursor on the Excel table display itself and rightclick, you should get a context menu with options to add/delete input/output variables. If you select "Properties", you should get the current configuration of the component and you can adjust accordingly.
TTFN
RE: combining excel and mathcad
I tried that. No such choices come up with the rightclick.
Under "Properties," I get two tabs: Display and Protect. I've turned Protect=Off (not that it mattered). Under Display, I have "Highlight Region" (off), "Show Border" (off) and "Tag". I've assigned a name to "Tag", but it doesn't change anything.
Edit and Open (under "Worksheet Options") are the only other rightclick choices, and they do just thatallow me to edit the spreadsheet within MathCAD or Excel, respectively. Neither approach lets me add or modify I/O control.
I'm running MathCAD 11 SP2a (it didn't work under SP1, either).
I appreciate your free help. Feel equally free to give up on this any time you like. I don't think there's a solution.
RE: combining excel and mathcad
>> You need to select only the table and not the entire expression containing the table. The context menu only pops up if the Excel table alone is selected.
>> Your installation is mucked up. You can check this by trying in insert a nex Excel component. If when you do that and it doesn't ask questions about creating a new one or from a file, your installation is honked up. If this does occur, and you've had an older version of Mathcad, you should have a program called Regtool in your Mathcad folder. If so, unregister and reregister all the components.
The Excel component works as I described it in a fully functional installation. I have the same configuration and checked it before I posted my previous response.
TTFN
RE: combining excel and mathcad
Apparently, the guy who built the MathCAD document before me got the Excel table insertion/inclusion all wrong. I can properly insert Excel tables in new files, as well as in the old file.
Maybe a little bit of judicial cut'n'paste and I can make it all right again.
RE: combining excel and mathcad
The variable is updated in the program and it is in the output variable location. This process seems very simple but I seem to have missed something.
JimBlech
RE: combining excel and mathcad
Thanks for your help on this. I've since given up and moved on.
I think this features scores high on the "Not Ready for Prime Time" listit sounds like it causes more frustration than it might be worth.
RE: combining excel and mathcad
When working with large file transfers, it takes some time for the save to take place. While this is occuring, there is not indication to the screen that this is happening. If you go to excel before the save is done, you lose the new information.
I go to the taskbar and look at CPU usage. When it settles down, I open the excel file (from excel). This is very cumbersome and not very intuitive but it works.
RE: combining excel and mathcad
I just want to display my MathCAD results in table format. It looks like the Excel component may be the only, or at least the best, way to do this. Can someone show me how to do this? I'm quite new to MathCAD so I will need fairly detailed instructions.
Thanks in Advance...
RE: combining excel and mathcad
The matrix output can be changed to a table format by doubleclicking the matrix and selecting the Display Options tab and changing the Matrix display style to Table. This can also be done for the entire sheet by selecting the menu item for FormatResults
TTFN
RE: combining excel and mathcad
I was not able to get a menu to show by doubleclicking on the matrix, any ideas?
RE: combining excel and mathcad
TTFN
RE: combining excel and mathcad
I still havn't been able to find the menu that allows me to convert the matrix to table format. I can only find the properties menu that allows me to outline or highlight it. Is there some trick to this?
Thanks for your help!
RE: combining excel and mathcad
TTFN