Skip to content

Instantly share code, notes, and snippets.

@yarrr-ru
Last active January 11, 2019 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yarrr-ru/0f2a7aeb572d77a1763cf3eddb558919 to your computer and use it in GitHub Desktop.
Save yarrr-ru/0f2a7aeb572d77a1763cf3eddb558919 to your computer and use it in GitHub Desktop.
x1=-1.0; x2=+1.0; y1=-1.5; y2=+4.5; z1=-1.0; z2=+1.0;
nx=7; ny=9; nz=5;
step_x=(x2-x1)/(nx-1); step_y=(y2-y1)/(ny-1); step_z=(z2-z1)/(nz-1);
step_min = min([step_x step_y step_z]);
[x,y,z]=meshgrid([x1:step_x:x2], [y1:step_y:y2], [z1:step_z:z2]);
f= 4.*x+x.^2.*y-z.*y;
isosurface(x,y,z,f), title('PS. Press<enter>');
pause;
close;
xx=reshape(x,1,nx*ny*nz);
yy=reshape(y,1,nx*ny*nz);
zz=reshape(z,1,nx*ny*nz);
ff= 4.*xx+xx.^2.*yy-zz.*yy;
p=[xx; yy; zz];
goal = 0.001;
spread = 1.0*step_min;
net = newrb(p,ff,goal,spread);
pause;
close;
net.layers{1}.size
smlt=sim(net,p);
[ff' smlt']
smltr=reshape(smlt,ny,nx,nz);
isosurface(x,y,z,smltr), title('AS. Press<enter>');
pause;
close;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment