フィルターのクリア

How to use linspace for a function already defined?

13 ビュー (過去 30 日間)
Richard Yang
Richard Yang 2015 年 11 月 26 日
コメント済み: Richard Yang 2015 年 11 月 26 日
Hi there,
I am using triple integrals to evaluate the volume of a cylindrical shaped item. I need to graph the volume as a result of an angle, but I can't seem to use linspace first to define a set of angles and then integrate after. Instead, I set the angle as a symbolic variable and did the variable, ending up with:
V1 = -125*pi*(tan(a1) - 1)
where a1 is the angle
How do I use linspace now to find V1 for a set of a1 angles? Basically, how do I turn a1 from a symbolic variable to a set of values (ex. a1 = linspace(0, pi);)
My end goal is to plot V1 as a function of a1, with a bound on a1 from 0 to pi in my example.
Let me know if this is unclear.
Thanks

採用された回答

Walter Roberson
Walter Roberson 2015 年 11 月 26 日
a1_vals = linspace(0, pi);
V1_vals = double( subs(V1, a1, a1_vals) );
plot(a1_vals, V1_vals)
  1 件のコメント
Richard Yang
Richard Yang 2015 年 11 月 26 日
Exactly what i needed! I originally used feval, but this fixed all my issues! Thanks!

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by