Removing values before plotting graph

I want to use an if statment to remove all values where X is larger than L before plotting a graph
however when i complete using this model nothing happens
any advice??

2 件のコメント

Johannes Rebling
Johannes Rebling 2020 年 5 月 5 日
Could you post the actual code and not a picture of it?
Sam Clifford
Sam Clifford 2020 年 5 月 5 日
M=m+2;
m=83;
N=10
V=linspace(1,10,N);
E=6;
L=4;
A=5;
U=1/2.*M.*V.^2.
F=sqrt((U*2*E*A)/L)
X=U.*2./F
if (X>L)
X=0
elseif X<L
plot(V,X)
end
a=(gradient(V,X).*V)
FP=m.*a

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

 採用された回答

KSSV
KSSV 2020 年 5 月 5 日
編集済み: KSSV 2020 年 5 月 5 日

1 投票

If X is your data and L is the number.
X(X>L) = [] ; % this removes elements from X which are larger than L

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

質問済み:

2020 年 5 月 5 日

編集済み:

2020 年 5 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by