際際滷

際際滷Share a Scribd company logo
Commandwindow1
>> clear
>> x=1:5
x =
1 2 3 4 5
>> y=1:3
y =
1 2 3
>> A =x*y
??? Error using==> mtimes
Innermatrix dimensionsmustagree.
>> [new_x,new_y]=meshgrid(x,y)
new_x =
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
new_y=
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
>> B=new_x*new_y
??? Error using==> mtimes
Innermatrix dimensionsmustagree.
>> B=new_x.*new_y
B =
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
>>

More Related Content

Comand window1

  • 1. Commandwindow1 >> clear >> x=1:5 x = 1 2 3 4 5 >> y=1:3 y = 1 2 3 >> A =x*y ??? Error using==> mtimes Innermatrix dimensionsmustagree. >> [new_x,new_y]=meshgrid(x,y) new_x = 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
  • 2. new_y= 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 >> B=new_x*new_y ??? Error using==> mtimes Innermatrix dimensionsmustagree. >> B=new_x.*new_y B = 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 >>