Much like SPHERE(), ELLIPSOID(), or SUPERQUAD(), these functions calculate and return the matrices required to plot a general superellipsoid or supertoroid using MESH() or SURF().
Unlike SUPERQUAD(), SUPERELLIPSOID() calculates the general form
with fully independent axis orders. i.e.:
((X-Cx) / Rx)^Px + ((Y-Cy) / Ry)^Py + ((Z-Cz) / Rz)^Pz = 1
For convenience, both functions accept parameters as vectors or as scalars with implicit expansion.
As with the built-in functions, the number of points can be set.
The default value for N is 50.
If no outputs are specified, a new surf plot will be created.
Display axes can be specified if the first argument is an axes handle.
A demo file is included (demo file uses subplot_tight from the FEX)
DGM (2021). Plot Superquadratic Surfaces (https://www.mathworks.com/matlabcentral/fileexchange/58413-plot-superquadratic-surfaces), MATLAB Central File Exchange. Retrieved .
I have tested this in R2019b, and everything appears to work normally.
I have only tested this in R2009b and R2015b. I do not anticipate any certain reasons that it should fail in R2019b. As Mathworks further develops the graphics/plot tools, those changes may eventually break the demo or the default surf() plot output. In such a case, it should still be able to correctly calculate numeric (array) outputs.
Does it not work in Matlab2019b?
My apologies, for the omission and my lateness. At the time I'd uploaded this, I was in the habit of excluding FEX dependencies. The function is available here:
thanks for yout code.! umm.. there's a missing function named "subplot_tight", however. Could you also provide this function?
Inspired by: Controllable tight subplot
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!