Cleve Moler's mandelbrot.m gives errors in Matlab R2019b

1 view (last 30 days)
In the book "Experiments with Matlab" of Cleve Moler (free ebook)
with source code
is an experiment mandelbrot.m.
When you run it, you should get a graphical menu.
It worked fine in R2017a, but now in R2019b there seem to be checks that are more strict:
>> mandelbrot
Error:File: mandelbrot.m Line: 54 Column: 14
Identifier 'depth' is not a function or a shared variable. To share 'depth' with nested function,
initialize it in the current scope. For more information, see Sharing Variables Between Parent and Nested Functions.
I have no clue where and what to change.
Do you know / have experience in what changed recently in matlab R2019b?
  1 Comment
Bert RAM Aerts
Bert RAM Aerts on 28 Oct 2019
Well in fact I was investigating how to use my nVIDIA GPU for Mandelbrot fractals. And I just found:
Very nice improvement factors.

Sign in to comment.

Accepted Answer

Bert RAM Aerts
Bert RAM Aerts on 29 Oct 2019
Edited: Bert RAM Aerts on 29 Oct 2019
Solution is very simple, just add following global variables to mandelbrot.m:
% to make R2019b happy (global variables)
depth = 0;
width = 0;
z = 0;
kz = 0;
center = 0;
cmapidx = 0;
% Switchyard.

More Answers (0)


Find more on Startup and Shutdown in Help Center and File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!