how do I make a temperature data matrix as sparse matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I cannot convert the temperature data matrix as a sparse matrix.Below is the glimpse of the matrix.
YEAR JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
1901 22.4 24.14 29.07 31.91 33.41 33.18 31.21 30.39 30.47 29.97 27.31 24.49
1902 24.93 26.58 29.77 31.78 33.73 32.91 30.92 30.73 29.8 29.12 26.31 24.04
1903 23.44 25.03 27.83 31.39 32.91 33 31.34 29.98 29.85 29.04 26.08 23.65
1904 22.5 24.73 28.21 32.02 32.64 32.07 30.36 30.09 30.04 29.2 26.36 23.63
1905 22 22.83 26.68 30.01 33.32 33.25 31.44 30.68 30.12 30.67 27.52 23.82
1906 22.28 23.69 27.31 31.93 34.11 32.19 31.01 30.3 29.92 29.55 27.6 24.72
1907 24.46 24.01 27.04 31.79 32.68 31.92 31.05 29.58 30.67 29.87 27.78 24.44
1908 23.57 25.26 28.86 32.42 33.02 33.12 30.61 29.55 29.59 29.35 26.88 23.73
1909 22.67 24.36 29.22 30.79 33.06 31.7 29.81 29.81 30.06 29.25 27.69 23.69
1910 23.24 25.16 28.48 31.42 33.51 31.84 30.42 29.86 29.82 28.91 26.32 23.37
1911 23.22 24.58 27.04 31.27 33.78 32.23 31.44 30.8 30.1 29.43 25.7 23.71
1912 23.7 26.07 28.7 31.29 33.3 33.18 31.05 30.18 30.19 29.64 26.37 23.7
1913 23.71 24.79 27.62 32.02 33.07 32.23 30.65 30.48 30.33 29.42 26.28 23.56
1914 24.42 24.77 28.01 30.96 33.23 32.67 30.55 29.96 30.19 28.63 26.75 23.82
1915 22.6 23.84 27.62 31.36 34.2 33.1 31.52 30.79 30.79 30.08 27.62 23.78
3 Kommentare
John D'Errico
am 18 Mär. 2018
Bearbeitet: John D'Errico
am 18 Mär. 2018
Sorry. That is an abstract. To read the full paper, we need to pay real money for it.
You are asking for help. If you force someone to not only read a full paper to have some idea what you are talking about, but to pay for access to that paper? Just to help you for free? Be serious.
Either make the effort to explain what your problem is, or find a consultant, where you will pay for their services. Or learn MATLAB.
Antworten (1)
John D'Errico
am 18 Mär. 2018
data = [1901 22.4 24.14 29.07 31.91 33.41 33.18 31.21 30.39 30.47 29.97 27.31 24.49
1902 24.93 26.58 29.77 31.78 33.73 32.91 30.92 30.73 29.8 29.12 26.31 24.04
1903 23.44 25.03 27.83 31.39 32.91 33 31.34 29.98 29.85 29.04 26.08 23.65
1904 22.5 24.73 28.21 32.02 32.64 32.07 30.36 30.09 30.04 29.2 26.36 23.63
1905 22 22.83 26.68 30.01 33.32 33.25 31.44 30.68 30.12 30.67 27.52 23.82
1906 22.28 23.69 27.31 31.93 34.11 32.19 31.01 30.3 29.92 29.55 27.6 24.72
1907 24.46 24.01 27.04 31.79 32.68 31.92 31.05 29.58 30.67 29.87 27.78 24.44
1908 23.57 25.26 28.86 32.42 33.02 33.12 30.61 29.55 29.59 29.35 26.88 23.73
1909 22.67 24.36 29.22 30.79 33.06 31.7 29.81 29.81 30.06 29.25 27.69 23.69
1910 23.24 25.16 28.48 31.42 33.51 31.84 30.42 29.86 29.82 28.91 26.32 23.37
1911 23.22 24.58 27.04 31.27 33.78 32.23 31.44 30.8 30.1 29.43 25.7 23.71
1912 23.7 26.07 28.7 31.29 33.3 33.18 31.05 30.18 30.19 29.64 26.37 23.7
1913 23.71 24.79 27.62 32.02 33.07 32.23 30.65 30.48 30.33 29.42 26.28 23.56
1914 24.42 24.77 28.01 30.96 33.23 32.67 30.55 29.96 30.19 28.63 26.75 23.82
1915 22.6 23.84 27.62 31.36 34.2 33.1 31.52 30.79 30.79 30.08 27.62 23.78];
temp = data(:,2:end);
year = data(:,1);
months = 1:12;
surf(months,year,temp)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/180161/image.jpeg)
A sparse matrix is absolute nonsense here.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!