Why won't my plot line show in plot?

1 次查看(过去 30 天)
wobbly
wobbly 2021-12-2
回答: Chunru 2021-12-2
Only a blank graph is showing up with no line.
for n_c = linspace(0.6,0.8,10)
W_eff = W_dot_net*(n_c)
end
plot(n_c,W_eff,'c-','MarkerSize',10)
axis auto
  2 个评论
Walter Roberson
Walter Roberson 2021-12-2
https://www.mathworks.com/matlabcentral/answers/1600965-why-won-t-my-plot-graph-a-line#answer_845460
to start

请先登录,再进行评论。

回答(1 个)

Chunru
Chunru 2021-12-2
W_dot_net = 3; % a constant
n_c = linspace(0.6,0.8,10);
% The following can be vectorized and simplified. But the loop form helps
% to understand the concept.
W_eff = zeros(size(n_c));
for i=1:numel(n_c)
W_eff(i) = W_dot_net*n_c(i);
end
plot(n_c,W_eff,'c-','MarkerSize',10)
axis auto

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by