Switching a Boundary Condition to Spherical Coordinates

3 vues (au cours des 30 derniers jours)
Hollis Williams
Hollis Williams le 22 Mar 2019
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.

Réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by