How do I save outputs to a vector from if statement
古いコメントを表示
MEI=[]
for node=0:dx:L;
if node>=0 && node<a
moment=@(x) (RA*x)
MEI=moment(node)
elseif node>=a && node<b
moment=@(x) (RA*x)-(Pa*(x-a))
MEI=moment(node)
elseif node>=b && node<=L
moment=@(x) (RA*x)-(Pa*(x-a))-(Pb*(x-b))
MEI=moment(node)
end
end
I want to save the outputs from the calculations to a 1 column vector. I can only save the last calculated value.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!