How to plot a time series contour with several unequal matrix?
1 view (last 30 days)
Show older comments
Hi guys!
I have pressure, time and temperature data from multiple observations .But the size of matrix are not the same!
For example, my 1st matrix look like this(and time might be 10:58, not include in the excel table):
But the next data set, the number of data may have over the amount of 1000!!
My first question is how to combine them through program?
At first, I try the code below:
As you can see, I have 18 staions, and I actually have more.
It can be combined by copy and paste for 18 and more times, but can it be more easier?
the problem in the code is that if number of data is unequal, MATLAB cannot combine them into one matrix
Also the function contourf cannot work since the wrong dimension of each matrix.
Thanks for reading all of them(and my poor expression)
0 Comments
Answers (1)
Abhisek Pradhan
on 29 Aug 2019
A simple way will be to concatenate all the matrixes vertically as all of them have the same number of columns. This can be done by reading the sheets in the excel files and saving it as a cell array and then concatenating the cell array to a matrix.
[~,sheet_name]=xlsfinfo('filename.xlsx');
for k=1:numel(sheet_name)
data{k}=xlsread('filename.xlsx',sheet_name{k});
end;
Iterate over all elements of the cell array and concatenate them using vertcat to form a matrix. Now contourf can be used for plotting.
0 Comments
See Also
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!