• 大小: 26.89MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-27
  • 语言: Matlab
  • 标签: matlab  

资源简介

可用matlab进行表白的理科生,主要包括音乐播放,玫瑰花,三维心等,以及三种可选择的方式

资源截图

代码片段和文件信息

function [  ] = begin(  )

[hootiefs]=wavread(‘Psycho.wav‘);
soundsc(hootiefs);

A=imread(‘01.png‘);
h0=figure(‘menubar‘‘none‘‘numbertitle‘‘off‘‘name‘‘I want to love you‘);
imshow(A);

axes
set(gca‘ydir‘‘reverse‘)
axis([0 2000 -1200 0]);
axis off;
set(gcf‘color‘‘k‘); 
N=50; 
handles=zeros(1N);
x(1:)=2000*rand(1N);        
x(2:)=-1200*rand(1N);  

fontsize=floor(rand(1N)*30+10); 
new_handles_N=0;
K=0;


for i=1:N
    handles(i)=text(x(1i)x(2i)‘*‘‘fontsize‘fontsize(i)‘color‘‘w‘);  %handles 存储每一个“雪花”的句柄
end
while 1
    if ~ishandle(h0) 
        return 
    end
    for i=1:N
    temp=get(handles(i)‘position‘);
    step=get(handles(i)‘fontsize‘)/48*0.05*1500;
            if temp(2)>0
                new_handles_N=new_handles_N+1;
                new_handles(new_handles_N)= copyobj(handles(i)gca);
                if new_handles_N==500 
                    delete(new_handles);
                    new_handles_N=0;
                end
                  temp(1)=rand(1)*2000;
                  temp(2)=-1200;
            else
                temp(1)=temp(1)+1500*rand(1)*0.1-80;
                temp(2)=temp(2)+step; 
            end
            set(handles(i)‘position‘temp‘rotation‘get(handles(i)‘rotation‘)+5);
    end
    if 0.05>rand
        k=floor(rand*3);
        for i=1:floor(rand*4)
            draw_main(1800*rand-50-200*sin(rand*pi));
            axis([0 2000 -1200 0]);
        end
        K=K+k;
    end
    pause(.2)
    if K>10
        K=K+1;
        if K>25
            break
        end
        continue
    end
end


end


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-08-23 15:23  wishhappy\
     文件      652281  2018-08-23 14:46  wishhappy\01.png
     文件      599134  2011-12-20 18:38  wishhappy\02.jpg
     文件         237  2018-08-22 19:16  wishhappy\HeartRate.m
     文件        1816  2018-08-22 19:45  wishhappy\IloveU.m
     文件    28606802  2018-08-22 18:24  wishhappy\Psycho.wav
     文件        1662  2018-08-23 14:50  wishhappy\begin.m
     文件        4086  2018-08-22 19:05  wishhappy\draw_main.m
     文件         532  2018-08-23 15:00  wishhappy\flower.m
     文件         443  2018-08-22 19:03  wishhappy\heart.m
     文件         566  2018-08-22 19:27  wishhappy\heart1.m
     文件        1388  2018-08-23 15:19  wishhappy\know.m
     文件        1059  2018-08-22 19:28  wishhappy\love.m
     文件        1726  2018-08-23 15:27  wishhappy\ready.m
     文件        1358  2018-08-23 14:54  wishhappy\write.m

评论

共有 条评论