z=xy

2 visualizzazioni (ultimi 30 giorni)
petros
petros il 22 Giu 2011
[x,y]=meshgrid(-6:1:6)
z=x*y
Is not giving the function z=x*y, anybody come across this issues pls?

Risposta accettata

Sean de Wolski
Sean de Wolski il 22 Giu 2011
perhaps you means an element-wise multiplication?
z = x.*y;
what you're doing above is a matrix multiplication from linear algebra.
  1 Commento
petros
petros il 22 Giu 2011
my bad, ya it works thnx! :)

Accedi per commentare.

Più risposte (1)

Laura Proctor
Laura Proctor il 22 Giu 2011
Or, you could use matrix multiplication with vectors:
x = -6:6;
z = x'*x

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by