Matlab is not plotting

1 次查看(过去 30 天)
Mahmoud Abbas
Mahmoud Abbas 2022-3-8
编辑: KSSV 2022-3-8
How to make matlab plot this (it shows an empty graph)
for i=1:10
M=1+i;
plot(i,M,'LineWidth',2)
hold on
end

采纳的回答

KSSV
KSSV 2022-3-8
编辑:KSSV 2022-3-8
As you are plotting a point, you need to use marker.
for i=1:10
M=1+i;
plot(i,M,'.','MarkerSize',5)
hold on
end
You can also plot all at once. Using:
i = 1:10 ;
M = i+1;
figure
plot(i,M,'.-')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by