Example Code

Mandelbrot Set Using LabVIEW

产品和环境

本部分要求填写创建该范例所需的产品和操作系统。

如要下载NI软件(包括以下所示产品),请访问ni.com/downloads

    软件

  • LabVIEW

代码和文档

添加附件

Overview
This example creates the Mandelbrot set and colors it with a continous color (smoothing) algorithm.

 

Description
By default the iteration count is set to 50 and is colored with a 24-bit color gradient.

The black section is the set of points in the complex plane. The edge forms a fractal (the complexity of this edge never simplifies regardless of the magnification level).

The outside area is colored based on the number of iterations it takes to exclude the pixel from the Mandelbrot set.

 

Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

 

  1. Run the VI
  2. 2.Mandelbrot image will show on front panel.

 

Additional Information or References
VI Block Diagram

 1.png

 

 

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

NI社区“代码范例交流区”(Example Code Exchange)中的代码范例已获得MIT许可

评论
TroyK
Active Participant
Active Participant
修改时间

Awesome, I love it. (My windows background is a zoomed in section of the Mandelbrot set fractal. Step12 in the link in your introduction.)

I hope you don't mind, I simplified the code a little, changed the way the picture updated and did a bit of manual tidying.

It updates much faster now. (Original took about 30seconds on my pc.)

See 'mandelbrot_lv82_2.vi'.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
StevieZ
NI Employee (retired)
修改时间

Thanks for updating it, I love the speed improvements. Based off your version of the code I may work on a version that will be able to be zoomable.

TroyK
Active Participant
Active Participant
修改时间

Your welcome! A zoom would be very cool. I wanted to suggest that but I forgot to add it to my previous comment.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
Everseeker
Member
Member
修改时间

So, 7 years later....

Did you (or anyone) create a zoomable version?

And, the "Improved" one that is in the comment... is not clickable does anyone have it?

TroyK
Active Participant
Active Participant
修改时间

I can't remember where I got the one just attached from (Mandel.vi) but if you turn on the cursors it is zoomable. It was originally written in LabVIEW 5 I think!

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
dj_tony
Member
Member
修改时间

i have a zoomable version. i don't remember who made it or where i found.

and if you enable item parallelism on the for loops the execution speed increase drammatically.

here the link:

 

https://drive.google.com/file/d/1gUvi3wypyI6pkiTJ92VJIjZDp5Dshi9P/view?usp=sharing

 

 

fell free to put this VI in other places more appropriate.

-------------------------------------------------------------------------------------
CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
rowdyr
Member
Member
修改时间

Here is another zoomable version that can be manipulated with the mouse which was based on the VIs at the top of the page...

 

Mandelbrot Explorer.jpg

 

https://www.icloud.com/iclouddrive/0eeohs3Hr7D3BC-ZGzeSDuNnA#Mandelbrot_Explorer

 

Enjoy.