Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Sep 01, 2018
04:25 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Sep 01, 2018
04:25 PM

exporting the vector of f(x,y) function into matrix or table.

Hi guys,

I have to export data for 3d plotting in excel.

what I have is a function f(x,y) which gives me the results in vector form of course.

anybody know how I can convert the vector into a matrix or export it to an excel sheet.

Best

ALi

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

Jan 26, 2019
04:37 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jan 26, 2019
04:37 AM

You use ranges instead of vectors, and hence you don't get matrices and can't use the export functions.

Attached is a way it should work. (Prime 4)

Success!

Luc

12 REPLIES 12

Jan 24, 2019
09:18 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jan 24, 2019
09:18 AM

Use WRITEEXCEL function, or Excel Component.

Jan 25, 2019
11:27 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jan 25, 2019
11:27 AM

Note that the OP posted his question over three months ago...

Luc

Luc

Jan 25, 2019
12:25 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jan 25, 2019
12:25 PM

@LucMeekes wrote:

Note that the OP posted his question over three months ago...

Luc

Yeah! Well:

- Bored,
- Looking for something to occupy my time. . . 😉

Jan 25, 2019
09:25 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jan 25, 2019
09:25 AM

@ptc-5892428 wrote:

Hi guys,

I have to export data for 3d plotting in excel.

what I have is a function f(x,y) which gives me the results in vector form of course.

anybody know how I can convert the vector into a matrix or export it to an excel sheet.

Best

ALi

First of all, you don't really have a vector.

Because you define A and B as range variables, your formula computes; but if you try to define a vector (Vc), the program throws an error. You can turn A and B into vectors (an undocumented and * dangerous* practice) by putting an "evaluation" equals sign after the definition; but the results aren't what you'd expect:

Why? Because A and B are both vectors, so the multiplication signs in the equation are interpreted as "dot products," and you get a single value answer. You can "vectorize" the equation (means evaluate for each set of values in each vector) and get:

But that's still not what you want.

I'm not sure how you would get a 3D plot in EXCEL; but in Mathcad you'd use the function "CreateMesh" to create a (very large) three column array (AKA matrix) that you'd then drop into a 3D plot.

Hope this helps!

Jan 25, 2019
06:34 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jan 25, 2019
06:34 PM

Hi Fred,

thank you for the explanation. firstly, I have a format issue with Mathcad graphs, journals ask for graphs in vector form.

exporting to excel helps me to use other software.

Honestly, I tried hard to understand how your and the others answers could help me but apparently, I didn't ask the right question.

I have this formula and graph and everything is okay and I happy with the results.

help me export the data to excel to plot it by let say MATLAB.

thanx

Jan 26, 2019
04:37 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jan 26, 2019
04:37 AM

You use ranges instead of vectors, and hence you don't get matrices and can't use the export functions.

Attached is a way it should work. (Prime 4)

Success!

Luc

Jan 28, 2019
05:37 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jan 28, 2019
05:37 PM

and that's what I wanted.

thank you Luc

Jan 29, 2019
01:56 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jan 29, 2019
01:56 AM

You're welcome.

You could mark the question/topic as answered...

Luc

Jan 27, 2019
10:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jan 27, 2019
10:55 AM

Could you please share how do you prepare your articles for journals?

It is possible to print / save a Mathcad Prime document to PDF or XPS file and 2D plots will be in vector format inside that PDF or XPS file, but 3D plots will be in raster format.

Jan 25, 2019
12:45 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jan 25, 2019
12:45 PM

Excel does not support a decent surface plot as far as I know. The surface plot in Excel simply takes a n x m matrix of z-values and shows a surface over an equidistant xy-grid. So all that would have to be done is create that kind of matrix at equidistant positions and export to Excel.

But as the thread is rather old and the questioner never came back to push the question its likely he is not interested anymore. Its surprising that nobody had answered that question months ago when it was fresh - maybe it was moved from a different (wrong) section to this forum just later and the thread did not bubble up because of the older date?

BTW, what we see in the sheet is a severe bug in Primes 3D plot!

The function arguments are mixed - the first, phi2, is a free, unassigned variable but the second, A, is range from 0 to 5. So we would expect to see the x axis from -10 to 10 and the y-axis from 0 to 5. In first sight the opposite seems to be true but on second sight the catastrophe: Prime exchanged x- and y-axis!!!!

Jan 25, 2019
01:10 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jan 25, 2019
01:10 PM

That axis reversal is OLD.

I pointed that out during a beta review (back when Mona was still here.) Shows how much I use 3D plots!

Jan 25, 2019
06:08 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jan 25, 2019
06:08 PM

@Fred_Kohlhepp wrote:

That axis reversal is OLD.

I pointed that out during a beta review (back when Mona was still here.) Shows how much I use 3D plots!

I wasn't aware of that bug in Prime. Shows how much I use Prime, I guess (not at all, except to answer in this forum).

It seems to have to do with the new syntax which in Prime is additionally allowed. In real Mathcad you get an error if you enter the function name PLUS arguments in the 3D-plot placeholder - no matter whether those arguments are defined as ranges or undefined variables.

Anyway - one more reason to control the output of a 3D plot only via CreateMesh - its more convenient and secure.