[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