How to plot a useful graph with a lot of data
조회 수: 29 (최근 30일)
이전 댓글 표시
I am trying to plot graphs for different variables against crash risk however each variable has nearly 62000 columns down so my graphs are coming out as shown above with no analysis really being able to be done at all. Just wondering if anyone at any tips
댓글 수: 6
Mario Malic
2023년 12월 21일
Maybe you should try to analyze your data w.r.t. car brands, years, categories of accidents?
채택된 답변
SAI SRUJAN
2023년 12월 27일
Hi Danny,
I understand that you are trying to plot graphs for a very large dataset, with each variable having around 62,000 data points.
This is a common challenge when working with large datasets, as traditional plotting methods can become ineffective due to overplotting, where too many data points overlap and make the plot unreadable. In the context of MATLAB, there are several functions and approaches that can help you manage and analyze your large dataset effectively:
Follow the given code snippet to proceed further,
% To sample your dataset,
% you can use the datasample function or simply use indexing to select a subset of your data.
sample_data = datasample(data, 1000, 'Replace', false);
% To decimate your data,
% MATLAB provides the decimate function, which reduces the sample rate of a signal by an integer factor.
decimated_data = decimate(data, factor);
%If you need to resample your data to a new fixed rate, you can use the resample function.
[resampled_data, new_time] = resample(data, original_time, new_rate);
For a comprehensive understanding of the mentioned functions in MATLAB, please refer to the following documentation.
I hope this helps.
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!