Skip to main content
1-Visitor
March 17, 2019
Solved

Combining three matrices into one

  • March 17, 2019
  • 8 replies
  • 7296 views
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!
Best answer by DJF

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

8 replies

DJF16-PearlAnswer
16-Pearl
March 18, 2019

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

25-Diamond I
March 18, 2019

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

B.jpg

zjv1-VisitorAuthor
1-Visitor
March 18, 2019
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
25-Diamond I
March 18, 2019

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

B.jpg

 

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.