Not sure why my code isn't working
>> [x,y]=meshgrid(-100:1:100, -100:1:100)
>> z = (-4.3461.*(10.^-7)).*[1/[1 + ((x.^2)./(30^2))].^1.5];
Error using /
Matrix dimensions must agree.

 Réponse acceptée

Star Strider
Star Strider le 4 Fév 2018
You need to vectorise every multiplication, division, and exponentiation:
z = (-4.3461.*(10.^-7)).*[1./[1 + ((x.^2)./(30^2))].^1.5];
VECTORISE HERE AS WELL

2 commentaires

Michelle Babak
Michelle Babak le 4 Fév 2018
thank you very much!
Star Strider
Star Strider le 4 Fév 2018
As always, my pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by