scatter Plot issues in Plotting

1 vue (au cours des 30 derniers jours)
Prasad Joshi
Prasad Joshi le 7 Fév 2022
Commenté : Prasad Joshi le 7 Fév 2022
I am doing a scatter Plot . In that I am loading the excel file for 27 cases and plotting in scatter plot . But by using for loop only last case value it is taking and plotting instead it should plot for all the cases . Can someone please help what is the error in the code . Thank you in advance .
A=xlsread('Compare_All_cases','B6:AB9')
for i=1:length(A)
time=[25,50,75,200]
Y=A(:,i)
scatter(time,Y,'filled','r')
for j= 1:4
text(time(j),Y(j),sprintf('(%.0f)',Y(j)))
end
end

Réponse acceptée

KSSV
KSSV le 7 Fév 2022
A=xlsread('Compare_All_cases','B6:AB9')
figure
hold on
for i=1:length(A)
time=[25,50,75,200]
Y=A(:,i)
scatter(time,Y,'filled','r')
for j= 1:4
text(time(j),Y(j),sprintf('(%.0f)',Y(j)))
end
end
You need not to use, a loop. You can do it in a single step.
  1 commentaire
Prasad Joshi
Prasad Joshi le 7 Fév 2022
Thank you sir

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Scatter Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by