function Happy_New_Year_2024()
fig = figure;
set(fig, 'Color', [0 0 0]);
hold on;
axis off;
axis equal;
axis([0 75 0 75]);
set(gca, 'color', [0 0 0]); % Set background to black
% Number of fireworks
n_fireworks = 40;
% Create fireworks
for i = 1:n_fireworks
% Randomly choose the center of the firework
center_x = rand() * 75;
center_y = rand() * 75 + 50;
% Randomly choose the number of particles
n_particles = randi([100, 100]);
% Generate particles
for j = 1:n_particles
% Random angle for the particle
angle = rand() * 2 * pi;
% Random length for the particle
length = rand() * 5 + 5;
% Calculate end point of the particle
end_x = center_x + length * cos(angle);
end_y = center_y + length * sin(angle);
% Random color for the particle
color = rand(1, 3);
% Plot the particle
plot([center_x, end_x], [center_y, end_y], 'Color', color, 'LineWidth', rand()*4);
end
% Pause a bit before the next firework
pause(0.1);
end
% Add multicolor text at the bottom
message = 'Happy New Year 2024: PIRC';
words = strsplit(message, ' ');
x_start = 10;
y_position = 30;
for w = 1:numel(words)
text_color = rand(1, 3);
text(x_start, y_position, words{w}, 'Color', text_color, 'FontSize', 18, 'FontWeight', 'bold');
x_start = x_start + numel(words{w}) *3.5;
end
hold off;
end

Matlab科研辅导帮
- 粉丝: 3w+
- 资源: 7819
最新资源
- 对标博主账号拆解【指令+教程】.rar
- 仿写名人语录【指令+视频教程】.rar
- 仿写文章指令【指令+教程】.rar
- 高质量广告语【指令+教程】.rar
- 公文写作【指令+教程】.rar
- DeepSeek使用教程蓝皮书.pdf
- 公众号推文【指令+教程】.rar
- 三阶CRFB结构Sigma-Delta调制器:入门SD ADC与Matlab/Simulink建模指南,高性能三阶CRFB结构Sigma-Delta调制器,附全差分、开关电容放大与simulink建模
- 截图与录屏制作GIF.zip
- 会议既要【指令+教程】.rar
- 基于MATLAB 2022a及以上的四轮转向汽车模型预测控制(MPC)路径跟踪仿真,MATLAB 2022a及以后版本:基于车辆动力学模型的四轮转向汽车MPC路径跟踪仿真,支持多种路面条件与外形变化
- 口水话变口播文案【指令+教程】.rar
- 教案板书【指令+视频教程】.rar
- 利用记忆宫殿背课文【指令+教程】.rar
- 联网搜热门话题,生成故事性文案【指令+视频教程】.rar
- springboot168基于springboot + vue的疫情隔离管理系统_zip.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


