• Remix
  • Share
  • New Entry

  • VMM

  • /
  • Matlab 40 landscaping

on 1 Dec 2023
  • 13
  • 37
  • 0
  • 2
  • 654
function drawframe(f)
scl = 1/2+sin(linspace(-pi/2,3*pi/2,48))/2;
azimuths = -45 + scl*40;
elevs = 10 + scl*65;
imgsz = 201;
L = membrane(1,(imgsz-1)/2)+rand(imgsz)*0.01;
x = linspace(-1,1,size(L,1));
y = fliplr(x);
img = zeros(imgsz);
rn = rand(imgsz)*0.2;
img = insertText(img, [18 40], ['MATLAB' newline '40 years'], 'FontSize', 36, 'BoxOpacity',0, 'FontColor','white');
img=rgb2gray(img);
se = strel('disk', 2);
dilated_img = imdilate(img, se);
mask = dilated_img > 0;
rn(mask) = 0;
blur_img = imgaussfilt(dilated_img, 2)*0.7 + rn;
bar3(blur_img)
shading flat
combo = (1-scl(f))*L+scl(f)*blur_img;
b = surf(x,y,combo);
view(azimuths(f),elevs(f))
colormap turbo
zlim([0, 1+0.2]);
clim([0;1])
axis off
shading interp
end
Animation
Remix Tree