MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB技术文章 (https://www.labfans.com/bbs/forumdisplay.php?f=25)
-   -   Blog Post Number 300, Vibrating Logo - Cleve Moler on Mathematics and Computing (https://www.labfans.com/bbs/showthread.php?t=27412)

poster 2023-12-14 04:55

Blog Post Number 300, Vibrating Logo - Cleve Moler on Mathematics and Computing
 
This is post number 300 of [I]Cleve's Corner[/I] blog. The first post was on June 6, 2012, which is 600 weeks ago. So, I have averaged one post every two weeks for over a decade. The posts were more frequent in the early days and are less frequent today.

[B]Contents[/B]
[LIST][*][URL="https://www.labfans.com/bbs/#ccc2ebb6-1c1e-46a0-b19b-455cc4058635"]Vibrating Logo[/URL][*][URL="https://www.labfans.com/bbs/#71788969-1610-4111-83ec-1f91f974b786"]Code[/URL][*][URL="https://www.labfans.com/bbs/#407dbfb8-a326-471c-ac13-3f5c58b66121"]vibrating_logo[/URL][*][URL="https://www.labfans.com/bbs/#ea75a53d-1aaa-4128-b51b-46fd84380580"]vibrating_logo_frame[/URL][*][URL="https://www.labfans.com/bbs/#355fe3db-750d-4a82-b9d9-7de0df29ee65"]first frame[/URL][*][URL="https://www.labfans.com/bbs/#4329c90d-ee62-412f-aa5d-018a818cca4d"]init_fig[/URL][/LIST][B]Vibrating Logo[/B]

For my 300-th post, I want to take another look at our MathWorks logo. Here is a modified version of one of the animations that I entered in the recent [URL="https://www.mathworks.com/matlabcentral/communitycontests/contests/6/entries"]MATLAB Flipbook Mini Hack[/URL].

[IMG]http://blogs.mathworks.com/cleve/files/vibrating_logo.gif[/IMG]

Vibrating LogoThe MathWorks company logo is the solution to a partial differential equation that describes how a disturbance travels through matter. I discussed the logo in a five-part blog post in 2014. Here are links to three of those posts.

[URL="https://blogs.mathworks.com/cleve/2014/10/13/mathworks-logo-part-one-why-is-it-l-shaped/"]Why is it L-shaped?[/URL].

[URL="https://blogs.mathworks.com/cleve/2014/11/17/mathworks-logo-part-four-method-of-particular-solutions-generates-the-logo/"]The method of particular solutions[/URL].

[URL="https://blogs.mathworks.com/cleve/2014/12/01/mathworks-logo-part-five-evolution-of-the-logo/"]How the view has evolved.[/URL].

One of my most-liked blog posts is by ten-year old [URL="https://blogs.mathworks.com/cleve/2021/12/23/a-new-view-of-our-logo/"]Eden Rajapakse[/URL].

[B]Code[/B]

This code is available at [URL="https://blogs.mathworks.com/cleve/files/vibrating_logo.m"]vibrating_logo[/URL].

[B]vibrating_logo[/B]

function vibrating_logo % MathWorks logo, vibrating L-shaped membrane. % See Cleve's Corner, Dec. 13, 2023. % [url]https://blogs.mathworks.com/cleve/2023/12/13/blog-post-number-300-vibrating-logo[/url]. stop = init_fig; fps = 6; f = 0; % Loop until stop is toggled. while true f = f + 1; if stop.Value return end vibrating_logo_frame(f) pause(1/fps) end[IMG]http://blogs.mathworks.com/cleve/files/vibes_blog_01.png[/IMG] [B]vibrating_logo_frame[/B]

function vibrating_logo_frame(f) % % One frame of animation. if f == 1 first_frame end fud = get(gcf,'UserData'); [mu,L,s] = deal(fud{:}); t = (f-1)/fps; Z = cos(mu(1)*t)*L{1} + sin(mu(2)*t)*L{2} + sin(mu(3)*t)*L{3} + ... sin(mu(4)*t)*L{4} + sin(mu(5)*t)*L{5} + sin(mu(6)*t)*L{6}; s.ZData = Z; end[B]first frame[/B]

function first_frame cla axis off % First six eigenvalues. mu = sqrt([9.6397238445, 15.19725192, 2*pi^2, ... 29.5214811, 31.9126360, 41.4745099]); % First six eigenfunctions. L{1} = 30*membrane(1,25); L{2} = 2*membrane(2,25); L{3} = -2*membrane(3,25); L{4} = 5*membrane(4,25); L{5} = -3*membrane(5,25); L{6} = 4*membrane(6,25); % Surf plot with custom lighting. axes('CameraPosition', [-193.4013 -265.1546 220.4819],... 'CameraTarget',[26 26 10], ... 'CameraUpVector',[0 0 1], ... 'CameraViewAngle',9.5, ... 'DataAspectRatio', [1 1 .9],... 'Visible','off', ... 'XLim',[1 51], ... 'YLim',[1 51], ... 'ZLim',[-13 40]); s = surface(zeros(size(L{1})), ... 'EdgeColor','none', ... 'FaceColor',[0.9 0.2 0.2], ... 'FaceLighting','phong', ... 'AmbientStrength',0.3, ... 'DiffuseStrength',0.6, ... 'Clipping','off',... 'BackFaceLighting','lit', ... 'SpecularStrength',1.0, ... 'SpecularColorReflectance',1, ... 'SpecularExponent',7); light('Position',[40 100 20], ... 'Style','local', ... 'Color',[0 0.8 0.8]); light('Position',[.5 -1 .4], ... 'Color',[0.8 0.8 0]); set(gcf,'UserData',{mu,L,s}) end[B]init_fig[/B]

function stop = init_fig % Initialize figure. fig = gcf; fig.Color = 'k'; fig.MenuBar = 'none'; fig.ToolBar = 'none'; fig.NumberTitle = 'off'; fig.Clipping = 'off'; stop = uicontrol; stop.Style = 'togglebutton'; stop.String = 'X'; stop.FontSize = 12; stop.FontWeight = 'bold'; stop.Units = 'normalized'; stop.Position = [.92 .92 .06 .06]; cla shg endend[RIGHT][COLOR=gray][I]
[URL="javascript:grabCode_cfdea481005c456d8c4a25238f900460()"][I]Get the MATLAB code (requires JavaScript)[/I][/URL]

Published with MATLAB® R2023a
[/I][/COLOR][/RIGHT]




[url=https://blogs.mathworks.com/cleve/2023/12/13/blog-post-number-300-vibrating-logo/?s_tid=feedtopost]More...[/url]


所有时间均为北京时间。现在的时间是 23:23

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.