If loop 3 condition

5 ビュー (過去 30 日間)
Shaban Akhtar
Shaban Akhtar 2019 年 4 月 1 日
コメント済み: Walter Roberson 2019 年 4 月 1 日
z=zeros(1,N);
h=z;
for ii=1:N
z(ii)=(ii- 0.5)*H;
if z(ii)>L1 && z(ii)<(L1+LL)
h(ii)=z(ii)-L1;
elseif z(ii)>(L1+LL)
h(ii)=LL;
else
h(ii)=0;
end
end
  3 件のコメント
Shaban Akhtar
Shaban Akhtar 2019 年 4 月 1 日
L1, LL, L2 has certain value. suppose L1 has value of 2m LL has 10 m and L2 has 4m . Now total length is L1+LL+L2. for z(i)<L1 h(i) =0 and for z(i)>L1 &z(i) <(L1+LL) h(i)=z(i)-L1 and for z(i)>(L1+LL), h(i) will be equals to LL only
z(ii) is correct, I got exact result but values of h(i) i dont get exact result.
Walter Roberson
Walter Roberson 2019 年 4 月 1 日
I still need the value for H in order to run the code.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by