Switching a Boundary Condition to Spherical Coordinates

3 visualizzazioni (ultimi 30 giorni)
I am working with a problem on a sphere where I have a formula which gives me the coordinates of a number of nodes distributed at equal distances from each other around a sphere in spherical polar coordinates, so if there are 100 nodes, I can use the formula to get a vector which is 3 x 100, each column corresponding to one of the nodes and then 3 entries for theta, phi, r.
For a boundary condition, I then need to create a 300 x 1 column vector, where you build the column by going to node 1, take cos of its theta component in first row, sin theta in second row, then 0 in the third row. You then go to next node and repeat this and move down the column until it is 300 x 1. What would be the easiest way of doing this?
Let me know if further explanation required.

Risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by