Answered

How can I keep the date visible at the bottom of the graph?

xticks should not be a double vector if you use datetime, it should be a datetime vector. I would expect anything else to return...

How can I keep the date visible at the bottom of the graph?

xticks should not be a double vector if you use datetime, it should be a datetime vector. I would expect anything else to return...

plus d'un an ago | 0

| accepted

Answered

Plotting multiple objects on same axis

If you have the image processing toolbox available, then there is a one-line solution to your problem. viscircles([x,y],on...

Plotting multiple objects on same axis

If you have the image processing toolbox available, then there is a one-line solution to your problem. viscircles([x,y],on...

plus d'un an ago | 1

Answered

Colorbar in colormap with labels

There range in your plotted values are 2-10, and the colorscale is per default scaled so that the maximum (10) and minimum (2) a...

Colorbar in colormap with labels

There range in your plotted values are 2-10, and the colorscale is per default scaled so that the maximum (10) and minimum (2) a...

plus d'un an ago | 2

| accepted

Answered

Show temperature differences in a dataset

Here you can see the difference between minimum and maximum taken over the 3rd dimension, which I can only assume is time? ...

Show temperature differences in a dataset

Here you can see the difference between minimum and maximum taken over the 3rd dimension, which I can only assume is time? ...

plus d'un an ago | 0

| accepted

Answered

question on months&days in 2012

Now that you've basically solved it, here is my (hopefully correct) solution. Note that for scalars you can write && instead of ...

question on months&days in 2012

Now that you've basically solved it, here is my (hopefully correct) solution. Note that for scalars you can write && instead of ...

plus d'un an ago | 0

| accepted

Answered

datenum to UTC?

Yes, use datetime instead of datenum. t = datetime('10-Oct-2013 15:59:00','timezone','-04:00') t_unix = posixtime(t)...

datenum to UTC?

Yes, use datetime instead of datenum. t = datetime('10-Oct-2013 15:59:00','timezone','-04:00') t_unix = posixtime(t)...

plus d'un an ago | 0

Answered

shifting time in timetable

Simply shifting the time without affecting the data TT.Time = dateshift(TT.Time,'start','day') Changing the format (hidi...

shifting time in timetable

Simply shifting the time without affecting the data TT.Time = dateshift(TT.Time,'start','day') Changing the format (hidi...

plus d'un an ago | 0

Answered

Summary Statistics Table by group

You need to pass the table as input to *grpstats*. Assuming that *dsa* is a cell array with grouping variables, then change your...

Summary Statistics Table by group

You need to pass the table as input to *grpstats*. Assuming that *dsa* is a cell array with grouping variables, then change your...

plus d'un an ago | 0

Answered

how to use imshow for this array?

It's not imshow but you could use imagesc instead imagesc(out_map) If you really want to use imshow, then B = mat2g...

how to use imshow for this array?

It's not imshow but you could use imagesc instead imagesc(out_map) If you really want to use imshow, then B = mat2g...

plus d'un an ago | 1

| accepted

Answered

Generate data from a image plot with colour code as reference.

I'd approach this by the following steps. load image with axes and everything: I = imread('FileName.png'); imshow(I) ...

Generate data from a image plot with colour code as reference.

I'd approach this by the following steps. load image with axes and everything: I = imread('FileName.png'); imshow(I) ...

plus d'un an ago | 0

| accepted

Answered

exstract consecutive duplicate element of array

A is your matrix. This line removes duplicates: A([false diff(A)==0]) = []; Or you could expand it to this, given your v...

exstract consecutive duplicate element of array

A is your matrix. This line removes duplicates: A([false diff(A)==0]) = []; Or you could expand it to this, given your v...

plus d'un an ago | 0

Answered

Subscript indices must either be real positive integers or logicals.

It's hard to tell without having some input, but these types of lines are definitely wrong: ra(2i)=1; *i* is being inter...

Subscript indices must either be real positive integers or logicals.

It's hard to tell without having some input, but these types of lines are definitely wrong: ra(2i)=1; *i* is being inter...

plus d'un an ago | 0

| accepted

Answered

Reading pixels of an image

Indexing works by going through the matrix column by column, so that would be (1,5) in your example. Don't be afraid to test thi...

Reading pixels of an image

Indexing works by going through the matrix column by column, so that would be (1,5) in your example. Don't be afraid to test thi...

plus d'un an ago | 1

Answered

How would i display a matrix as a graph?

Here's a custom plot type I made. It may look upside down, but the value on the y-axis denotes the row number. The "peak value" ...

How would i display a matrix as a graph?

Here's a custom plot type I made. It may look upside down, but the value on the y-axis denotes the row number. The "peak value" ...

plus d'un an ago | 0

| accepted

Answered

Surface plot of vectors with x and y vectors as index

After meshgrid you need to interpolate. For example z = griddata(xx, yy, zz, x, y) Then you can plot surf(x, y, ...

Surface plot of vectors with x and y vectors as index

After meshgrid you need to interpolate. For example z = griddata(xx, yy, zz, x, y) Then you can plot surf(x, y, ...

plus d'un an ago | 0

Answered

Based on Column 3 values how to get specific column 1 values?

fid = fopen('sample.txt') out = textscan(fid,'%f%f%f','headerlines',1); fclose(fid) A = cell2mat(out); id0 = f...

Based on Column 3 values how to get specific column 1 values?

fid = fopen('sample.txt') out = textscan(fid,'%f%f%f','headerlines',1); fclose(fid) A = cell2mat(out); id0 = f...

plus d'un an ago | 1

| accepted

Answered

Draw a discontinuous line

Do not use indexed variable names. Build a 2xn matrix instead. x = 0.7000 1.8000 1.3000 2.2000 y = ...

Draw a discontinuous line

Do not use indexed variable names. Build a 2xn matrix instead. x = 0.7000 1.8000 1.3000 2.2000 y = ...

plus d'un an ago | 0

| accepted

Answered

plotting colorcoded points on a map

Try this: scatterm(long_lat(:,2),long_lat(:,1),[],sen_s) I assume sen_s is the variable you want colorcoded. Adapt the c...

plotting colorcoded points on a map

Try this: scatterm(long_lat(:,2),long_lat(:,1),[],sen_s) I assume sen_s is the variable you want colorcoded. Adapt the c...

plus d'un an ago | 0

| accepted

Answered

Plot of maximum value of chosen column in matrix

In this case you could simply find the max in each column in one go [vm,idx] = max(M); %maximum of each column plot(t,M); ...

Plot of maximum value of chosen column in matrix

In this case you could simply find the max in each column in one go [vm,idx] = max(M); %maximum of each column plot(t,M); ...

plus d'un an ago | 0

Answered

Help to understand Matlab code

[m n ~] = size(im) ~ basically means "omit this output", and is totally useless in this context. It is useful in other case...

Help to understand Matlab code

[m n ~] = size(im) ~ basically means "omit this output", and is totally useless in this context. It is useful in other case...

plus d'un an ago | 1

| accepted

Answered

how to find time difference between 2 times , in milliseconds.

Just work with duration format. t={'18:42:45.813' '18:42:46.028' '18:42:46.139' '18:42:46.359' '18:42:46.463' ...

how to find time difference between 2 times , in milliseconds.

Just work with duration format. t={'18:42:45.813' '18:42:46.028' '18:42:46.139' '18:42:46.359' '18:42:46.463' ...

plus d'un an ago | 1

| accepted

Answered

Seperate the data of a table

Just use logical indexing T{strcmp(T{:,1},'Fossil Gas'),end} The line strcmp(T{:,1},'Fossil Gas') returns a logi...

Seperate the data of a table

Just use logical indexing T{strcmp(T{:,1},'Fossil Gas'),end} The line strcmp(T{:,1},'Fossil Gas') returns a logi...

plus d'un an ago | 0

| accepted

Answered

Plot of confidence interval with fill

Nothing wrong, you just happen to have very narrow confidence bounds. <</matlabcentral/answers/uploaded_files/137818/untitle...

Plot of confidence interval with fill

Nothing wrong, you just happen to have very narrow confidence bounds. <</matlabcentral/answers/uploaded_files/137818/untitle...

plus d'un an ago | 0

| accepted

Answered

How to make a scatterplot

Let Y be your matrix with data, you can simply make a scatterplot like this: x = 61:70; h = plot(x,Y,'bo','markerfaceco...

How to make a scatterplot

Let Y be your matrix with data, you can simply make a scatterplot like this: x = 61:70; h = plot(x,Y,'bo','markerfaceco...

plus d'un an ago | 0

| accepted

Answered

how to read .dat file using txtscan ?

You can use readtable since the data is tabular. T = readtable('AE33_AE33-S02-00184_20170102.dat','headerlines',8) ...g...

how to read .dat file using txtscan ?

You can use readtable since the data is tabular. T = readtable('AE33_AE33-S02-00184_20170102.dat','headerlines',8) ...g...

plus d'un an ago | 1

| accepted

Answered

How to make a 2-D colormap with coordinates

Use a surface object surf(lon, lat, z) The data must be gridded, so you may have grid the data like this [LON,LAT]...

How to make a 2-D colormap with coordinates

Use a surface object surf(lon, lat, z) The data must be gridded, so you may have grid the data like this [LON,LAT]...

plus d'un an ago | 0

Answered

Squared heatmap with random transition; animation

You could also use scatter with a superlarge markersize. figure; colormap([1 1 1;1 1 0;1 0 0;0 0 1;0 1 0]); [...

Squared heatmap with random transition; animation

You could also use scatter with a superlarge markersize. figure; colormap([1 1 1;1 1 0;1 0 0;0 0 1;0 1 0]); [...

plus d'un an ago | 1

| accepted

Answered

how could avoid too have loop in big data

You can use findgroups/splitapply or put the data in a table and use varfun or grpstats. Upload some data if you need code. ...

how could avoid too have loop in big data

You can use findgroups/splitapply or put the data in a table and use varfun or grpstats. Upload some data if you need code. ...

plus d'un an ago | 1

| accepted

Answered

How to make a graph that shows evolution of a variable in time through different depths in a lake.

Just create a surface object. d = is your depth (1x38) t = is your time (1x3705) Te = is your temperature (3705...

How to make a graph that shows evolution of a variable in time through different depths in a lake.

Just create a surface object. d = is your depth (1x38) t = is your time (1x3705) Te = is your temperature (3705...

plus d'un an ago | 0

| accepted

Answered

How can make arrows into the line step by step?

What you see on the figure is a quiver3 plot, where the arrows describe velocity. You did not provide any velocity data, but you...

How can make arrows into the line step by step?

What you see on the figure is a quiver3 plot, where the arrows describe velocity. You did not provide any velocity data, but you...

plus d'un an ago | 0

| accepted