z=xy

조회 수: 2 (최근 30일)
petros
petros 2011년 6월 22일
[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일
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일
Or, you could use matrix multiplication with vectors:
x = -6:6;
z = x'*x

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by