Get Help

Turn on suggestions

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

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Combining three matrices into one

Options

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

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

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-17-2019
02:48 PM

03-17-2019
02:48 PM

Dear friends,
I need a bit of help. I have a set of values "PFscan.csv". It contains 70 columns x 1800 rows. This values represent z, and should be connected with r and t data, acting as a x and y. To create a x,y,z set with same dimensions I've made a matrices M1 and M2 from r and t, both containing 70 columns x 1800 rows. The goal is to combine this three sets into one matrix, which will consecutively contain (x,y,z)i. Hence matrix M3.
So the questions are:
How can I export this as .csv or .txt while being able to maintain order; x1,y1,z1, x2,y2,z2, etc.?
How can I plot multiple datasets into one 3D graph by using for loop? And to convert this large x,y,z set to polar plot?
Thanks!

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-18-2019
12:23 PM

03-18-2019
12:23 PM

I may not be completely sure what you are after, but I think the attached example (5.0) does something close.

8 REPLIES 8

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-18-2019
12:23 PM

03-18-2019
12:23 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-18-2019
05:16 PM

03-18-2019
05:16 PM

Re: Combining three matrices into one

Its unclear to me what kind of matrices you'd like to create but maybe the attached Prime5 file can help with plotting the data

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-18-2019
07:35 PM

03-18-2019
07:35 PM

Re: Combining three matrices into one

Dear Werner,
Can you integrate your approach into a new file I've submitted? I used DJF routine to create data-file that can be exported to other software. However, I really like your approach since it enables fast visualization of data within Prime5. I tried to do this myself, but your undocumented trick (not anymore :)) stopped working for some reason
Thanks,
zjv

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-18-2019
07:47 PM

03-18-2019
07:47 PM

Re: Combining three matrices into one

Not sure which problem you ran into - I don't see any error or that you copied any necessary regions into your sheet .

You don't need to use the undocumented trick I mentioned to create the necessary vectors. You already did it using normal program routines.

So simply replace my "vec_r" for your "rad" and you may create "vec_t" using your "theta" by simply writing "vec_t:= theta*deg" as the values you provide obviously are in degree and not radians.

BTW, you may created the necessary vectors more streamlined as shown below

P.S.: IN case you didn't notice it - the trick mentioned was to define a range and immediately follow it by an evaluation (= sign). This turns the range into a vector of values. If you don't use the = sign it won't work.

The standard way to create a vector is like shown above.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-18-2019
09:52 PM

03-18-2019
09:52 PM

Re: Combining three matrices into one

Hi Werner,
I don't know why but I still had problems with integrating your part with my document. For some reason, the part shown in image below was not possible to calculate (rows(vec_r) and rows(vec_t) was reporting an error ???). However, when used in your document alone, everything worked correctly. Thus, I decided to split file - one for exporting data (merging parts from DJF) and other for plotting (your approach).
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-18-2019
10:43 PM

03-18-2019
10:43 PM

Re: Combining three matrices into one

Hard to say why it failed without seeing the file with the error.

BTW, your description does not correspond to the data structure you create:

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-20-2019
04:18 PM

03-20-2019
04:18 PM

Re: Combining three matrices into one

Werner, thanks for the comment, I haven't noticed an error before. Now it is corrected. The file is attached. I still have a problem with vec_r and vec_t error like as shown in attached image.

Thanks.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-20-2019
07:34 PM

03-20-2019
07:34 PM

Re: Combining three matrices into one

The problem is that you defined variables "rows" and "cols" and therefore the built in identically named functions are not available anymore.

Solution: Use different names for your variables. As variable names are case sensitive you may even call them "Rows" and "Cols" if you like.

Top Tags