The halloween is approaching. Mathworks presents the following Matlab code to draw a Pumpkin. % Pumpkin =sphere(200); R=1-(1-mod(0:.1:20,2)).^2/12; x=R.*X; y=R.*Y; z=Z.*R; c=hypot(hypot(x,y),z)+randn(201)*.03; surf(x,y,(.8+(0-(1:-.01:-1)’.^4)*.3).*z,c, ‘FaceColor’, ‘interp’, ‘EdgeColor’, ‘none’) % Stem s = .* ,1,10) .1 ]’; = meshgrid(0:pi/15:pi/2,0:pi/20:pi); Xs = -(.4-cos(p).*s).*cos(t)+.4; Zs = (.5-cos(p).*s).*sin(t) + .55; Ys = -sin(p).*s; surface(Xs,Ys,Zs,,’FaceColor’, ‘#008000′,’EdgeColor’,’none’); % Style colormap() axis equal box on material() lighting g camlight –EOF (The Ultimate Computing & Technology Blog) — 125 words The Permanent URL is: Draw a Pumpkin using Matlab
The post Draw a Pumpkin using Matlab first appeared on Algorithms, Blockchain and Cloud.
The halloween is approaching. Mathworks presents the following Matlab code to draw a Pumpkin. % Pumpkin =sphere(200); R=1-(1-mod(0:.1:20,2)).^2/12; x=R.*X; y=R.*Y; z=Z.*R; c=hypot(hypot(x,y),z)+randn(201)*.03; surf(x,y,(.8+(0-(1:-.01:-1)’.^4)*.3).*z,c, ‘FaceColor’, ‘interp’, ‘EdgeColor’, ‘none’) % Stem s = .* ,1,10) .1 ]’; = meshgrid(0:pi/15:pi/2,0:pi/20:pi); Xs = -(.4-cos(p).*s).*cos(t)+.4; Zs = (.5-cos(p).*s).*sin(t) + .55; Ys = -sin(p).*s; surface(Xs,Ys,Zs,,’FaceColor’, ‘#008000′,’EdgeColor’,’none’); % Style colormap() axis equal box on material() lighting g camlight –EOF (The Ultimate Computing & Technology Blog) — 125 words The Permanent URL is: Draw a Pumpkin using Matlab
The post Draw a Pumpkin using Matlab first appeared on Algorithms, Blockchain and Cloud.
Related posts:
Simple Animation – Random Shapes – Learn Processing and ProcessingJS In , random coloured squares are drawn on console using C++ based on CodePage 437….
Proof without Words: 1 + 2 + 3 + .. (n – 1) = Cn2 Google ‘Proof without Words‘ you will find some interesting figures that are easy to understand….
Teaching Kids Programming – Check if a String is Prefix/Suffix in Python (Two Pointer Algorithm) Teaching Kids Programming: Videos on Data Structures and Algorithms Prefix Algorithm using Two Pointer in…
Characteristic Attributes Essential for Successful Software Engineers Passion for Learning Technology evolves, and as a software engineer, you would need a passion…
Simple and Fast Hash Functions in Delphi A Hash function returns a 32-bit (or sometimes 64-bit) integers for any given length of…
Teaching Kids Programming – From Linear Search to Binary Search Algorithm Teaching Kids Programming: Videos on Data Structures and Algorithms Linear Search Algorithm to Find Square…
Teaching Kids Programming – Restore the Word from Rules Teaching Kids Programming: Videos on Data Structures and Algorithms Given a list of rules in…
Python Function to Solve the Chicken and Rabbit Math Problem Problem statement: Given a cage that has R rabbits and C chicken, and we know… Read More Algorithms, Blockchain and Cloud