there is no plotting appearance
显示 更早的评论
u=32620
l=1*10^-6
a=u/l
t=1*10^-6:100:1*10^-4
b=a.*t
y=b*exp(-t/10^-6)
plot(t,y)
1 个评论
VBBV
2024-5-25
As @Stephen23 mentioned , use of linspace or logspace is more appropriate to plot graphs
t = linspace(1e-6,1e-4,100) y = b.*exp(-t/10^-6) %use element wise multiplication also.
Use also element wise multiplication operation.
回答(1 个)
"there is no plotting appearance"
Because you are plotting exactly one data point. By default there PLOT shows lines (which connect data points) and no data point markers. Because you have exactly one data point there is therefore no line and no marker.
If you want to make one data point visible then define a marker:
u = 32620;
l = 1*10^-6;
a = u/l;
t = 1*10^-6:100:1*10^-4
b = a.*t;
y = b*exp(-t/10^-6)
plot(t,y,'*')
1 个评论
Perhaps you incorrectly expect this line:
t = 1*10^-6:100:1*10^-4
to produce a vector of values. You attempted to go from 1e-6 to 1e-4 in steps with size 100. How many steps of size 100 can you fit between 1e-6 and 1e-4 ? None, so only the first data point is returned.
You were probably attempting something like this:
t = linspace(1e-6,1e-4,100)
or, given the range of values, perhaps this:
t = logspace(-6,-4,100)
类别
在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

