how to plot like this
    4 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Afsher P A
 il 27 Lug 2020
  
    
    
    
    
    Commentato: Afsher P A
 il 27 Lug 2020
            
Sample data
April19 [ 1 2 3....30 31] % days
Kwh = [ 40 43 44...40 41]
May19 [ 1 2 3....30 31] % days
Kwh = [ 39 43 42...41 42]
.
.
.
March20 [ 1 2 3....30 31] % days
Kwh = [ 50 49 40...45 44]
2 Commenti
Risposta accettata
  Image Analyst
      
      
 il 27 Lug 2020
        Try this:
data = readmatrix('data.xlsx')
months = {'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'};
[rows, columns] = size(data)
for k = 1 : 2 : columns
	plot(data(:, k), data(:, k+1), '.-', 'LineWidth', 2, 'MarkerSize', 20);
	hold on;
end
fontSize = 18;
xlabel('Day', 'FontSize', fontSize);
ylabel('kWh', 'FontSize', fontSize);
grid on;
legend(months);

Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Workspace Variables and MAT Files in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


