question about matlab farfiled sphere 3D image(really need help....)

1 view (last 30 days)
SPHERE3D Error: Rho must be scalar, positive and real. Xout = []
Yout = []
Zout = []
Cmap = [] >> size(Rho) ans = 2701 1
what does this erro mean?
what is the meaning of this code?
[p,q] = size(Rho);
if (((p ~= 1)|(q ~= 1))|~isreal(Rho))|(ischar(Rho)|Rho < 0)
here is what written in my matlab code:
[p,q] = size(Rho);
if (((p ~= 1)|(q ~= 1))|~isreal(Rho))|(ischar(Rho)|Rho < 0)
disp('SPHERE3D Error: Rho must be scalar, positive and real.');
Xout = []; Yout = []; Zout = []; Cmap = [];
return
end
I defined the Parameters below:
X = sind(theta).*cosd(phi);
Y = sind(theta).*sind(phi);
Z = cosd(theta);
meshscale=1;
plotspec = 'surf';
interpspec = 'nearest';
Zscale = 1;
Xin=Rho.*X;
Yin=Rho.*Y;
Zin= Rho.*Z;
The attachment contains the whole function code SPHERE 3D.m
thanks a lot!

Answers (0)

Community Treasure Hunt

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

Start Hunting!