MATLAB Community

MATLAB,社区等

发布给WordPress

This blog post began its life as a Live Script in MATLAB. I could have started typing into WordPress, but then I wouldn't have been able to do this.
Stand back...
m = linspace(-3*pi,3*pi,400);
[x,y] = meshgrid(m);
s = sin(x)。*sin(y)。*log(abs(x))。*log(abs(y));
imagesc(s)
Colormap(Colorcube)
equal off
Yowza!
That's a lot of popcorn for not very much code. What on earth is going on here? Much of the drama comes from thewildly varying colormap。让我们从侧面看这个表面。
冲浪(x,y,s)
阴影平坦的
配色栏
Let's strip away the color to get a better picture. What is the underlying shape?
冲浪(x,y,s)
colormap([0.5 0.75 0.4])
离开; shading平坦的; material乏味的
set(gca, DataAspectRatio=[1 1 1.5])
光(位置= [10 1 10])
view([-20 30])
We can decompose it still further to see that there's a sort of egg carton texture being multiplied by a four-petal folded shape. We are conveniently glossing over some infinities along the axes.
s1 = sin(x).*sin(y);
s2 = log(abs(x)).*log(abs(y));
cla
surface(x,y,s1)
表面(X,Y,S2/5+7)
离开; shading平坦的; material乏味的
set(gca, DataAspectRatio=[1 1 0.75])
光(位置= [10 1 10])
view([-20 20])
在实时脚本中解剖此图像很有趣。但这不是我今天要谈论的。我想谈论的是:我在MATLAB编辑器中键入此内容,并且您正在WordPress中读取它。那是怎么发生的?

From code to prose

我敢肯定,您可以想象将实时脚本移至博客平台上的各种乏味的方法。它将涉及大量复制和粘贴文本和屏幕截图的单个图像。但是,如果我告诉你这很容易,只花了几秒钟?
Okay, let me less hypothetical: I AM telling you it was super easy and only took a few seconds. And you can do it too, with the help of the new, freeWordPress Publishing Toolavailable right now on theFile ExchangeGitHub。And since I like MATLAB scripts and blogging, this makes me very happy. The tool was created by MathWorks developer Cheng Chen, and I've been using early versions of it for a while. One example is the在我宣布迷你黑客大赛。鉴于其中的所有MATLAB计算,很难创建任何其他方式。但是这样,这很轻松。
The easiest way to get started with the Publishing Tool is to go to the Add-Ons Explorer in MATLAB. Search for "WordPress" and add the file. Once you've got everything installed (there's a plugin on the WordPress side and an app on the MATLAB side), run the MATLAB app. After you've provided some details about your blog, just press the big "Publish" button and you're on your way.
Publisher.png
I would provide a link to the resulting article, but you're reading it right now!

特别感谢Sumihiro

Today's starting image, by the way, was adapted from Sumihiro's对称entry in the Mini-Hack contest that we ran last fall. That entry was inspirational, getting remixed for a record total of 32 times! Not to mention the fact that I am further remixing it right here. Thanks Sumihiro!
And if you create your own blog post using this tool, please include a link to it in the comments below!

|
  • print
  • send email

注释

To leave a comment, please click这里to sign in to your MathWorks Account or create a new one.