I have the following 3d plot in MATLAB that I'm trying to plot in Gnuplot but don't know how to. In MATLAB, the x,y,z are matrices that are calculated inside a nested for loop, then plotted:
w = 50 ;
ww = 0:1:w ;
d = 100 ;
dd = 0:1:d ;
for i=1:1:length(ww)
for j=1:1:length(dd)
x(i,j) = dd(i) ; % need to refer to array dd
y(i,j) = dd(j) ;
z(i,j) = <A complicated function ommitted for simplicity>
end
end
plot3(x,y,z)
How would I plot the above in Gnuplot? I need to do it for arbitrary values of w and d. I understand that I need the splot function but I am at a loss as to how to implement the calculation of the x,y,z matrices. Help will be appreciated!
Edit: It seems like the above can be done using the array and word keywords/function but I haven't been able to implement it yet