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

1 次查看(过去 30 天)
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?

采纳的回答

Bert RAM Aerts
Bert RAM Aerts 2019-10-29
编辑:Bert RAM Aerts 2019-10-29
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.
...

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by