Plotting functions #735
Nelson-numerical-software
started this conversation in
Ideas
Replies: 6 comments
-
f = figure();
x = repmat(linspace(-1, 1), [100,1]);
y = x';
r = x .^ 2 + y .^ 2;
z = exp(-r * 3) .* cos(5*r);
c = r;
surf(x, y, z, c);
view(3);
title('Made with love with Nelson'); |
Beta Was this translation helpful? Give feedback.
0 replies
-
f = figure();
t = 0:pi/500:40*pi;
xt = (3 + cos(sqrt(32)*t)).*cos(t);
yt = sin(sqrt(32) * t);
zt = (3 + cos(sqrt(32)*t)).*sin(t);
plot3(xt,yt,zt)
xlabel('x(t)')
ylabel('y(t)')
zlabel('z(t)') |
Beta Was this translation helpful? Give feedback.
0 replies
-
f = figure()
subplot(2,2,1)
x = repmat(linspace(-1, 1), [100,1]); y = x';
z = exp(x .^2 - y .^2);
image(z)
subplot(2,2,2)
t = 0:pi/500:40*pi;
xt = (3 + cos(sqrt(32)*t)).*cos(t);
yt = sin(sqrt(32) * t);
zt = (3 + cos(sqrt(32)*t)).*sin(t);
plot3(xt,yt,zt)
xlabel('x(t)')
ylabel('y(t)')
zlabel('z(t)')
subplot(2,2,3)
H = plot(rand(5));
subplot(2,2,4)
x = linspace(-2*pi,2*pi);
y1 = sin(x);
y2 = cos(x);
plot(x,y1,x,y2) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Mandelbrot's fractal function mandelbrot(varargin)
if (nargin == 1)
n = varargin{1};
else
n = 600;
end
its=80;
tol=1.0e6;
colscale=128;
xmin=-1;
xmax=2.25;
ymin=-1.5;
ymax=-ymin;
deltax=xmax-xmin;
deltay=ymax-ymin;
X=zeros(n,n);
for k=1:n+1
for l=1:n+1
x=xmin+deltax*(k-1)/n;
y=ymin+deltay*(l-1)/n;
tau=x+j*y;
z=f(0,tau);
m=0;
while norm(z)<tol && m<its
z=z^2-tau;
m=m+1;
end
if norm(z)>tol || isinf(z) || isnan(z)
X(l,k)=round(colscale*m/its);
end
end
end
figure()
image(X)
axis off
end |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Faster mandelbrot using vectorization (x100) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Compatible plotting functions will come before end of the year (2022) in Nelson
Here some preview:
Beta Was this translation helpful? Give feedback.
All reactions