Creating Graphs from Data in a .csv Files
조회 수: 91 (최근 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!