Clear Filters
Clear Filters

use NaN in matrix to get a spherical shape

1 view (last 30 days)
yonatan s
yonatan s on 6 May 2017
Commented: yonatan s on 6 May 2017
i want solve a pde in spherical coordinates, but failed to do so using the pde toolbox. my plan b is to use a matrix instead, and i want to know if i can insert NaN values to the cells i dont need in order to get the spherical shape, and still be able to run the equations over the matrix without any errors.
also, would i be able to plot the matrix, so only the cells with values will be visible?
if not, is it even possible to solve a 3d pde problem with spherical symmetry in matlab (version 2016b)?
  2 Comments
John D'Errico
John D'Errico on 6 May 2017
Of course it is "possible". That you did not succeed is merely a reflection that you did not write the correct code.
Of course you CAN put NaNs in some cells. That part is easy. But be careful that those NaNs won't propagate.
I'd suggest you may be better off using a spherical coordinate system. Write the problem in a different form. Then solve it over the entire spherical domain.
yonatan s
yonatan s on 6 May 2017
you pretty much stated the obvious

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!