Creating Graphs from Data in a .csv Files
48 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
The file Windhoek_temp_01_2022.csv contains temperature information for the month of January 2022. For each day of the month, the average temperature [C], minimum temperature [C], maximum temperature [C] are tabulated.
After loading the data, create a graph visualizing the temperatures (all in the same graph). Choose visually pleasing intervals to be shown for the abscissa and ordinate. Follow all guidelines regarding the creation of "proper" graphs. Don't forget to provide a meaningful title for your graph.
Note: You will receive at most 5 points if you manually copy and paste the data into the Jupyter Notebook.
This are the codes i have so far but they don't bring up any graph
my_csv=readtable('Windhoek_temp_01_2022.csv'); %Reading the data
disp(my_csv); % Displaying the data just to confirm
% Creating a path for the headers
Temperature = my_csv(:,1);
Average_Temperature =my_csv(:,2);
Minimum_Temperature =my_csv(:,3);
Maximum_Temperature =my_csv(:,4);
plot(Temperature,Average_Temperature);
plot(Temperature,Minimum_Temperature);
plot(Temperature,Maximum_Temperature);
shg()
0 commentaires
Réponses (1)
Voss
le 31 Mai 2022
Subscripting a table with ( ) gives you another table. To get the data out of a table, subscript with { }
my_csv=readtable('Windhoek_temp_01_2022.csv'); %Reading the data
disp(my_csv); % Displaying the data just to confirm
% Creating a path for the headers
Temperature = my_csv{:,1};
Average_Temperature =my_csv{:,2};
Minimum_Temperature =my_csv{:,3};
Maximum_Temperature =my_csv{:,4};
plot(Temperature,Average_Temperature);
plot(Temperature,Minimum_Temperature);
plot(Temperature,Maximum_Temperature);
shg()
0 commentaires
Voir également
Catégories
En savoir plus sur Spreadsheets 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!


