Matrix is singular to working precision. Meshgrid

[x,y] = meshgrid(0.1:0.01:1,0.1:0.01:1);
z = ((1-x)*(cos(2*pi*y+(pi + atan((cos(2*pi*y)-1)/(2*pi*(1-y)+sin(2*pi*y)))))-...
cos(pi + atan((cos(2*pi*y)-1)/(2*pi*(1-y)+sin(2*pi*y))))))/((1-y)*(cos(2*pi*x...
+(pi + atan((cos(2*pi*x)-1)/(2*pi*(1-x)+sin(2*pi*x)))))-cos(pi + atan((cos(2*pi*x)-1)/(2*pi*(1-x)+sin(2*pi*x))))));

 Respuesta aceptada

Rik
Rik el 18 de Mzo. de 2021
Editada: Rik el 18 de Mzo. de 2021
You aren't using elementwise operations anywhere. You should replace every * by .* and every / by ./, that way you will not be doing matrix operations.
[x,y] = meshgrid(0.1:0.01:1,0.1:0.01:1);
z = ((1-x).*(cos(2*pi*y+(pi + atan((cos(2*pi*y)-1)./(2*pi*(1-y)+sin(2*pi*y)))))-...
cos(pi + atan((cos(2*pi*y)-1)./(2*pi*(1-y)+sin(2*pi*y))))))./((1-y).*(cos(2*pi*x...
+(pi + atan((cos(2*pi*x)-1)./(2*pi*(1-x)+sin(2*pi*x)))))-cos(pi + atan((cos(2*pi*x)-1)./(2*pi*(1-x)+sin(2*pi*x))))));
surf(x,y,z),view(45,30)

Más respuestas (0)

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Preguntada:

el 18 de Mzo. de 2021

Comentada:

el 18 de Mzo. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by