Hey :)
When I execute this code, the interpreter complains about y in the complex number c. I'm stuck :( Does anybody know the answer?
function m = mandelbrot(x,y)
nMax = 1000;
n=0;
z = 0;
c = x+i*y;
for n = [0:nMax]
z = z**2 + c ;
endfor
if abs(z)>2
m=1;
else
m=0;
endif
end

 Akzeptierte Antwort

Mischa Kim
Mischa Kim am 16 Jan. 2014
Bearbeitet: Mischa Kim am 16 Jan. 2014

0 Stimmen

I would assume it's the z**2 (the double star) that's causing the problem. What are you trying to do there? There's a couple of other issues ( endfor , e.g.)...

Weitere Antworten (1)

Martial
Martial am 16 Jan. 2014

0 Stimmen

Thank you Mischa :) It's an alternative way for writing x^2 in Octave.

1 Kommentar

Mischa Kim
Mischa Kim am 16 Jan. 2014
That's what I thought. Welcome to MATLAB, Martial.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 16 Jan. 2014

Kommentiert:

am 16 Jan. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by