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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to export to excel file x-y point of a function?

sguercilena
1-Visitor

How to export to excel file x-y point of a function?

Hi,

I would like to export to an excel file the coordinate point Xa-Zd. Zd is function of Xa as you can see in attached. I need 1199 values of Zd in excel.

ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald III
(To:StuartBruff)

Forgot to add .. you'll need to vectorize your function, because the derivative operator only acts on scalars (and it's always safer to do so as there might be other unintended vector operations that occur, such as dot product rather than element-by-element multiplication).

Stuart

View solution in original post

5 REPLIES 5
StuartBruff
23-Emerald III
(To:sguercilena)

stefano guercilena wrote:

Hi,

I would like to export to an excel file the coordinate point Xa-Zd. Zd is function of Xa as you can see in attached. I need 1199 values of Zd in excel.

There is (I believe, because I don't have Prime on my current PC) a function WRITEEXCEL (or similar) that should do the job.  I think there is also an Excel data output block.  Look up Excel in Prime help.

Here's an example from an earlier Community question:

WriteXL_test.png

Stuart

Hi Stuart and thank you for your answer,

I already tried, the problem is that Zd(Xa) isn't a vector/array/matrix but an evaluation of a function!!  I think it's not possible in mathcad

StuartBruff
23-Emerald III
(To:sguercilena)

stefano guercilena wrote:

Hi Stuart and thank you for your answer,

I already tried, the problem is that Zd(Xa) isn't a vector/array/matrix but an evaluation of a function!!  I think it's not possible in mathcad

Ah! The real problem is that X.a is a range variable, and WRITEEXCEL expects the data to be a matrix.   There are a couple of ways round this:

I usually use the vec(z) approach and the vec function is a permanent item in my Normal Template ... I think it works in Prime..

Stuart

StuartBruff
23-Emerald III
(To:StuartBruff)

Forgot to add .. you'll need to vectorize your function, because the derivative operator only acts on scalars (and it's always safer to do so as there might be other unintended vector operations that occur, such as dot product rather than element-by-element multiplication).

Stuart

Thank you Stuart for your time !!

Announcements

Top Tags