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.

 채택된 답변

Star Strider
Star Strider 2018년 2월 4일

0 개 추천

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

Michelle Babak
Michelle Babak 2018년 2월 4일
thank you very much!
Star Strider
Star Strider 2018년 2월 4일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2018년 2월 4일

편집:

2018년 2월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by