speed_cat_0 发表于 2011-2-23 22:27

how to do this problem???

n=';
>> S=[.001,0.0002,0.0010,0.0008,0.0003]';
>> B=';
>> H=';
>> table=n,S,B,H

table =

    0.0350
    0.0200
    0.0150
    0.0300
    0.0220


S =

1.0e-003 *

    1.0000
    0.2000
    1.0000
    0.8000
    0.3000


B =

    10
   8
    19
    24
    15


H =

    2.0000
    1.0000
    1.5000
    3.0000
    2.5000
U=sqrt(S)/n(B*H/B+2*H)^2/3
??? Error using ==> mtimes
Inner matrix dimensions must agree.
whta is wrong with this equation?you guys can type chinese.i use school's computer,i cantot type chinese.

mhkmars 发表于 2011-2-24 17:17

本帖最后由 mhkmars 于 2011-2-24 17:18 编辑

回复 1 # speed_cat_0 的帖子

既然是矩阵,那么就应该使用点运算,例如*应该为.*;/应该为./

mhkmars 发表于 2011-2-24 17:20

回复 1 # speed_cat_0 的帖子

>> n=';
S=[.001,0.0002,0.0010,0.0008,0.0003]';
B=';
H=';
>> U=sqrt(S)/n(B*H/B+2*H)^2/3
??? Error using ==> mtimes
Inner matrix dimensions must agree.

>> U=sqrt(S)./n.*(B.*H./B+2.*H).^2/3

U =

   10.8421
    2.1213
   14.2302
   25.4558
   14.7618

See? done
页: [1]
查看完整版本: how to do this problem???