I found that two points for reconsindering
- meshgrid function requires unique array of x, y, z.
- surf function requires the surface definition but your input is volume data
If you would like to know the isosurface, I hope the following code would be helpful. Or if you would like to define the surface, the following link will be helpful. 2 次元または 3 次元の散布データの内挿 - MATLAB griddata - MathWorks 日本
i=1;
for p=0:0.01:1
for q=0:0.01:1-p
for r=0:0.01:1-p-q
[ua,ub]=BNE(p,q,r);
E(i)=ua+ub;
x(i)=p;
y(i)=q;
z(i)=r;
i=i+1;
end
end
end
[X,Y,Z]=meshgrid(unique(x),unique(y),unique(z));
vq = griddata(x,y,z,E,X,Y,Z);
isosurface(X,Y,Z,vq,0.5)
function [ua, ub] = BNE(p,q,r)
ua = p+q;
ub = q+r;
end