Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
初级会员
注册日期: 2008-11-02
年龄: 54
帖子: 2
声望力: 0 ![]() |
![]()
當Tac 和 Tab 都小於2000時,請問如何找到 L 的最小值?
再加一個 While Loop? L=3:0.1:6.7; th = acos((45-L.^2)/36); ph = asin((6*sin(th))./L); j=1; Tab = 2000./(sin(th)+cos(th).*tan(ph)); if Tab<2000 then Tac = (2000.*cos(th))./(sin(th)+cos(th).*tan(ph)); if Tac<2000 then ARRAY(j)=(L,Tab,Tac) j=j+1; end end plot(ARRAY(:,1),ARRAY(:,2),'m',ARRAY(:... of AC'),ylabel('Tension'),title('Tension Plot'); legend('Tab','Tac'); |
![]() |
![]() |
![]() |
#2 |
初级会员
注册日期: 2008-11-02
年龄: 54
帖子: 2
声望力: 0 ![]() |
![]()
L由最小的開始,利用while迴圈判斷何時Tab或Tac會大於2000,若同時都小於2000就停下來,併記錄j,也就是L的最小長度L(j)
L=3:0.1:6.7; th = acos((45-L.^2)/36); ph = asin((6*sin(th))./L); Tab = 2000./(sin(th)+cos(th).*tan(ph)); Tac = (2000.*cos(th))./((sin(th)+cos(th).*tan(ph))); j=1; while Tab(j)>=2000 | Tac(j)>=2000 j=j+1; end L(j) 執行結果 L = 3.4000 |
![]() |
![]() |
![]() |
主题工具 | |
显示模式 | |
|
|
![]() |
||||
主题 | 主题作者 | 版面 | 回复 | 最后发表 |
[求助]矩阵元素位置的确定 | u235u457 | MATLAB论坛 | 2 | 2009-02-19 23:20 |
求灰度共生矩阵源程序 | myd.7986 | MATLAB论坛 | 0 | 2008-12-26 15:26 |
[分享]给新手的建议 | guofeng0108 | MATLAB论坛 | 0 | 2008-12-16 09:51 |
[求助]进来帮我看下这几个题目 | 我是心云 | MATLAB论坛 | 2 | 2008-11-30 23:17 |
Studying the World's Most Complex Dynamic Systems | TechnicalArticles | MATLAB技术文章 | 0 | 2008-08-29 00:40 |