Continuous Wavelet 2D Plot Help.

I have data of in the form of Matrix, the period is 30 and month range is of 12, I want to plot it in Continuous Wavelet 2D Plot. I followed this link but couldn't actually get it working, Kindly help me in generating it.
Sample data is:
1 23 23
2 56 98
3 12 12
4 65 65
5 89 89
6 52 52
7 41 45
8 36 36
9 98 98
10 74 74
11 22 98
12 3 3
13 36 36
14 45 78
15 12 12
16 3 3
17 5 23
18 8 36
19 7 7
20 1 1
21 6 89
22 1 1
23 1 1
24 6 6
25 9 9
26 98 98
27 4 4
28 4 4
29 6 6
30 9 9
31 6 6
The type of image I am expecting is this:

Réponses (1)

KSSV
KSSV le 7 Mai 2021

0 votes

Let A be your data matrix.
%% Structured grid
x = A(:,1) ;
y = A(:,2) ;
z = A(:,3) ;
nx = length(unique(x)) ;
ny = length(unique(y)) ;
X = reshape(x,nx,ny) ;
Y = reshape(y,nx,ny) ;
Z = reshape(z,nx,ny) ;
pcolor(X,Y,Z)
%% unstructured grid
x = A(:,1) ;
y = A(:,2) ;
z = A(:,3) ;
m = 100 ;n = 100 ;
x = linspace(min(x),max(x),m) ;
y = linspace(min(y),max(y),n) ;
[X,Y] = meshgrid(x,y,z,X,Y) ;
pcolor(X,Y,Z)

3 commentaires

Abdullah Irfan
Abdullah Irfan le 7 Mai 2021
Getting this error:
"Error using reshape
To RESHAPE the number of elements must not change.".
Also sorry, I forgot to add, the attached image is what type of image I am expecting from the data
KSSV
KSSV le 7 Mai 2021
I have given you two methods....try the other one....If not attach your complete data.
Abdullah Irfan
Abdullah Irfan le 7 Mai 2021
Yes dear, but both didn't work, as for second one X and Y variables are extra, meshgrid only accepts 3 variables.
As for complete data, its here:
1 23 23 23 23 23 23 23 23 23 23 23 23 23
2 56 98 56 98 56 98 56 98 56 98 56 98 56
3 12 12 12 12 12 12 12 12 12 12 12 12 12
4 65 65 65 65 65 65 65 65 65 65 65 65 65
5 89 89 89 89 89 89 89 89 89 89 89 89 89
6 52 52 52 52 52 52 52 52 52 52 52 52 52
7 41 45 41 45 41 45 41 45 41 45 41 45 41
8 36 36 36 36 36 36 36 36 36 36 36 36 36
9 98 98 98 98 98 98 98 98 98 98 98 98 98
10 74 74 74 74 74 74 74 74 74 74 74 74 74
11 22 98 22 98 22 98 22 98 22 98 22 98 22
12 3 3 3 3 3 3 3 3 3 3 3 3 3
13 36 36 36 36 36 36 36 36 36 36 36 36 36
14 45 78 45 78 45 78 45 78 45 78 45 78 45
15 12 12 12 12 12 12 12 12 12 12 12 12 12
16 3 3 3 3 3 3 3 3 3 3 3 3 3
17 5 23 5 23 5 23 5 23 5 23 5 23 5
18 8 36 8 36 8 36 8 36 8 36 8 36 8
19 7 7 7 7 7 7 7 7 7 7 7 7 7
20 1 1 1 1 1 1 1 1 1 1 1 1 1
21 6 89 6 89 6 89 6 89 6 89 6 89 6
22 1 1 1 1 1 1 1 1 1 1 1 1 1
23 1 1 1 1 1 1 1 1 1 1 1 1 1
24 6 6 6 6 6 6 6 6 6 6 6 6 6
25 9 9 9 9 9 9 9 9 9 9 9 9 9
26 98 98 98 98 98 98 98 98 98 98 98 98 98
27 4 4 4 4 4 4 4 4 4 4 4 4 4
28 4 4 4 4 4 4 4 4 4 4 4 4 4
29 6 6 6 6 6 6 6 6 6 6 6 6 6
30 9 9 9 9 9 9 9 9 9 9 9 9 9
31 6 6 6 6 6 6 6 6 6 6 6 6 6
The type of output (yes it won't be exact image but it should have overview of like this image with scale next to it).
BTW Thanks a lot for your quick responses.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Wavelet Toolbox dans Centre d'aide et File Exchange

Produits

Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by