[x,y]=meshgrid(-6:1:6)
z=x*y
Is not giving the function z=x*y, anybody come across this issues pls?

 채택된 답변

Sean de Wolski
Sean de Wolski 2011년 6월 22일

1 개 추천

perhaps you means an element-wise multiplication?
z = x.*y;
what you're doing above is a matrix multiplication from linear algebra.

댓글 수: 1

petros
petros 2011년 6월 22일
my bad, ya it works thnx! :)

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

추가 답변 (1개)

Laura Proctor
Laura Proctor 2011년 6월 22일

2 개 추천

Or, you could use matrix multiplication with vectors:
x = -6:6;
z = x'*x

카테고리

태그

Community Treasure Hunt

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

Start Hunting!

Translated by