声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 972|回复: 2

[编程技巧] how to do this problem???

[复制链接]
发表于 2011-2-23 22:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
n=[0.035,0.020,0.015,0.030,0.022]';
>> S=[.001,0.0002,0.0010,0.0008,0.0003]';
>> B=[10,8,19,24,15]';
>> H=[2,1,1.5,3,2.5]';
>> 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.
回复
分享到:

使用道具 举报

发表于 2011-2-24 17:17 | 显示全部楼层
本帖最后由 mhkmars 于 2011-2-24 17:18 编辑

回复 1 # speed_cat_0 的帖子

既然是矩阵,那么就应该使用点运算,例如*应该为.*;/应该为./
发表于 2011-2-24 17:20 | 显示全部楼层
回复 1 # speed_cat_0 的帖子
  1. >> n=[0.035,0.020,0.015,0.030,0.022]';
  2. S=[.001,0.0002,0.0010,0.0008,0.0003]';
  3. B=[10,8,19,24,15]';
  4. H=[2,1,1.5,3,2.5]';
  5. >> U=sqrt(S)/n(B*H/B+2*H)^2/3
  6. ??? Error using ==> mtimes
  7. Inner matrix dimensions must agree.

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

  9. U =

  10.    10.8421
  11.     2.1213
  12.    14.2302
  13.    25.4558
  14.    14.7618

复制代码
See? done

评分

1

查看全部评分

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-12-28 06:00 , Processed in 0.086417 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表