Creating Graphs from Data in a .csv Files
61 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Voss
2022 年 5 月 31 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


