My graph in matlab has a blank strip in the middle
Show older comments
i graphed the following
if true
% code
end[x,y]=meshgrid(-1:.01:1, -1:.01:1);
a = .619211.*x.^2;
b = (53913.*x.^8.*y.^2 + 2560.*x.^6);
c = 232.192.*(b).^1/2;
d = (c - 53913.*x.^4.*y).^1/3;
e = a./d;
f = (53913.*x.^8.*y.^2 + 2560.*x.^6).^1/2;
g = 232.192.*f;
h = (g - (53913.*x.^4.*y));
i = .0011982.*[(h).^1/3];
z = e - i;
surf(x,y,z);shading interp
and now my graph has a strip running through the middle that is blank. how do i get rid of it/fix it
Accepted Answer
More Answers (1)
dpb
on 23 Jul 2014
z(isnan(z))=0;
surf(x,y,z)
I didn't look to see which term precisely causes the problem but you've got a numerical issue somewhere that's giving a row of nan for y=0 I believe it is.
2 Comments
Joseph Cheng
on 23 Jul 2014
I think its is actually when x=0 is where it Nan. If we go back to your original question. and look where these equations come from
http://www.mathworks.com/matlabcentral/answers/uploaded_files/15756/doc1.pdf there are the equations shown when x~=0. Are there modifications to the equation for when x=0? or specific equations for when x does = 0;
Nismeta
on 23 Jul 2014
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!