0

I would like to reproduce pringle shape in Octave. Please, look at the attachment - that is done in Mathematica using "Region" function. Is possible to cut that circular shape also in Octave? Until now I've got this (code below) but it has rectangular shape/ platform not circular like in Mathematica (picture below).

a = 10
b = 10
x = [-10:.1:10];
y = [-10:.1:10];
[xx, yy] = meshgrid (x, y);
z = xx.^2/a.^2 - yy.^2/b.^2
h = surf(xx,yy,z);
colormap hsv;
set(h,'linestyle','none');

enter image description here

Adriaan
  • 17,741
  • 7
  • 42
  • 75
Aaa A
  • 79
  • 5
  • 1
    Please read the tag descriptions on [tag:octave] and [tag:matlab]. Do **not** use both tags unless you are explicitly asking about the similarities or differences between the two languages. They are not the same and by using both tags you're unnecessarily constraining potential answerers to validate that their code works in both languages. – Adriaan Mar 25 '22 at 10:53
  • Your `x` and `y` contain points in a square region. If you make those variables contain only points in a circular region, then the plot will be of a circular region. Try converting polar coordinates to Cartesian. – Cris Luengo Mar 25 '22 at 14:06
  • Hello Cris, did you mean conversion from cartesian to polar because currently I am using cartesian coordinates. – Aaa A Mar 25 '22 at 15:32

0 Answers0