I can Not include my condition

1 回表示 (過去 30 日間)
Hamid
Hamid 2014 年 12 月 8 日
コメント済み: Hamid 2014 年 12 月 8 日
Hi everybody,
I want to put a condition in my code, This is the code:
for i = 1:ne
nodnum=zeros(1,nen);
for j = 1 : nen
check=Dof(:,1:nend)-ones(n,1)*Edof(i,(j-1)*nend+2:j*nend+1);
[indx,dum]=find(check==0);
nodnum(j)=indx(1);
end
Ex(i,:)=Coord(nodnum,1)';
if nsd>1
Ey(i,:)=Coord(nodnum,2)';
end
if nsd>2
Ez(i,:)=Coord(nodnum,3)';
end
Le(i)=sqrt((Ex(i,1)-Ex(i,2))^2+(Ey(i,1)-Ey(i,2))^2+(Ez(i,1)-Ez(i,2))^2);
and this is that I want to put as a condition,
(Le(i)/Ep(i,6))>200
please help me out
  2 件のコメント
Zoltán Csáti
Zoltán Csáti 2014 年 12 月 8 日
Why don't you just put that condition to the specific place with an if structure?
Hamid
Hamid 2014 年 12 月 8 日
編集済み: Hamid 2014 年 12 月 8 日
Thank you Zoltán Csáti
I don't know how to do this because I want Ex,Ey,Ez obtain base on
(Le(i)/Ep(i,6))>200

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

採用された回答

Thorsten
Thorsten 2014 年 12 月 8 日
if Le(i)/Ep(i,6) > 200
% do something
end
  6 件のコメント
Hamid
Hamid 2014 年 12 月 8 日
Dear Thorsten
Ex,Ey,Ez are coordinates for elements, They must be numbers otherwise it has no meaning.
Thanks.
Hamid
Hamid 2014 年 12 月 8 日
PLEASE HELP ME Thorsten

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNaNs についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by