How to plot a time series contour with several unequal matrix?

1 次查看(过去 30 天)
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):
short array.PNG
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:
code.PNG
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)

回答(1 个)

Abhisek Pradhan
Abhisek Pradhan 2019-8-29
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.

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

产品


版本

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by