plot w=exp(-x/0.3042) (when 0<w<1)

4 ビュー (過去 30 日間)
haeri
haeri 2023 年 7 月 30 日
回答済み: Sam Chak 2023 年 7 月 30 日
i want to plot w=exp(-x/0.3042) (when 0<w<1)
and i also want to plot the graph of x when 0<w<1
but it constantly error. thanks for reading

回答 (3 件)

Torsten
Torsten 2023 年 7 月 30 日
移動済み: Torsten 2023 年 7 月 30 日
Here is an example:
x = linspace(0,1,10);
f = @(x) x.^2;
plot(x,f(x))
If you want to learn MATLAB basics, invest two hours of your time and pass the free online tutorial:
  1 件のコメント
haeri
haeri 2023 年 7 月 30 日
thank you for your links. it is very helpful.

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


VBBV
VBBV 2023 年 7 月 30 日
w=@(x) exp(-x/0.3042)
w = function_handle with value:
@(x)exp(-x/0.3042)
fplot(w,[0 1])
  2 件のコメント
VBBV
VBBV 2023 年 7 月 30 日
編集済み: VBBV 2023 年 7 月 30 日
you can rearrange the equation and use same function, fplot as shown earlier
x = @(w) -log(w)*0.3042
x = function_handle with value:
@(w)-log(w)*0.3042
fplot(x,[0 1])
haeri
haeri 2023 年 7 月 30 日
thanks for your help!!!!!

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


Sam Chak
Sam Chak 2023 年 7 月 30 日
The plotting is merely a basic skill that you can learn in MATLAB Onramp. More importantly, you need to know some properties of the exponential decay function before plotting it over the range .
In fact, there is a difference between plotting over and over .
When , .
When , .
x = linspace(0, 5, 1001);
w = exp(-x/0.3042);
plot(x, w), grid on, xlabel('x'), ylabel('w')
w(end) % w(x = 5)
ans = 7.2727e-08
The value of is very small, but it is not absolute zero... yet.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by