Bouquet of colorful Roses with MATLAB

http://spr.ly/6040KOreY This beautiful rose inspired me and I added more colors to it.
19 Downloads
Updated 16 Feb 2022

View License

n=800;
p=pi;
cmp=[parula turbo hsv hot cool spring summer autumn winter gray bone copper pink jet];
[R,T]=ndgrid(linspace(0,1,n),linspace(-2,20*p,n));
x=1-(.5)*((5/4)*(1-mod(3.6*T,2*p)/p).^2-.25).^2;
U=2*exp(-T/(8*p));
L=sin(U);
J=cos(U);
y=1.99*(R.^2).*(1.2*R-1).^2.*L;
K=x.*(R.*L+y.*J);
X=K.*sin(T);
Y=K.*cos(T);
Z=x.*(R.*J-y.*L);
for rep=1:14
figure(rep)
surf(X,Y,Z,'LineStyle','none')
grid,axis off;
colormap([cmp(:,(3*rep)-2),cmp(:,(3*rep)-1),cmp(:,3*rep)])
end
I referred a code from LinkedIn where they made a beautiful rose with jet colormap. I added my creativity to it and created a couple of roses with different colormap options available using simple for loop with extra added creativity. I hope you will enjoy this.

Cite As

KARTHIK B D (2026). Bouquet of colorful Roses with MATLAB (https://www.mathworks.com/matlabcentral/fileexchange/106805-bouquet-of-colorful-roses-with-matlab), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2021b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.02

.

1.0.01

Change in uploaded file

1.0.0