Please do not send private requests per e-mail, as I wish for my contributions to reach a broader audience. If you specifically want help from me, feel free to grab my attention by sending an email with a link to your question.

Answered

Is it possible to identify data in a for loop?

I would probably collect the data in the loop instead and then call plot outside of the loop. Could use something like this: d=...

Is it possible to identify data in a for loop?

I would probably collect the data in the loop instead and then call plot outside of the loop. Could use something like this: d=...

8 Tage ago | 0

| accepted

Answered

Display data ONLY inside closed polygons

Super simple if you have X,Y,Z with Z being elevation as well as a closed polygon defined by xp and yp %some sample data [X,Y]...

Display data ONLY inside closed polygons

Super simple if you have X,Y,Z with Z being elevation as well as a closed polygon defined by xp and yp %some sample data [X,Y]...

9 Tage ago | 0

| accepted

Answered

Merge .txt files with specific suffix

Could do something like this if you have a small number of "groups". For a large number of groups, I would suggest just extracti...

Merge .txt files with specific suffix

Could do something like this if you have a small number of "groups". For a large number of groups, I would suggest just extracti...

9 Tage ago | 0

Answered

RGB Image re-interlacing missing output colors.

I'm guessing your input image is uint8 (0 = black, 255 = saturated) and that your output image is class double (0 = black, 1 = ...

RGB Image re-interlacing missing output colors.

I'm guessing your input image is uint8 (0 = black, 255 = saturated) and that your output image is class double (0 = black, 1 = ...

12 Tage ago | 0

| accepted

Answered

How to check if my time series has a repeated hour in a matrix of 10200 rows?

Convert everything to datetime and then check the difference %some data, note that 2000-1-1 10:00:00 is repeated t = datetime(...

How to check if my time series has a repeated hour in a matrix of 10200 rows?

Convert everything to datetime and then check the difference %some data, note that 2000-1-1 10:00:00 is repeated t = datetime(...

12 Tage ago | 0

| accepted

Answered

Saving gray scale image

Using a single color channel to convert your image to grayscale is not optimal. The gray tone is usually a combination of red, b...

Saving gray scale image

Using a single color channel to convert your image to grayscale is not optimal. The gray tone is usually a combination of red, b...

12 Tage ago | 1

| accepted

Answered

How can I georeference this grid/matrix?

With the mapping toolbox you can just replace your plot functions with the corresponding map axes function. load coastlines a...

How can I georeference this grid/matrix?

With the mapping toolbox you can just replace your plot functions with the corresponding map axes function. load coastlines a...

15 Tage ago | 0

Answered

how to load an ASCII file

Based on the sample given in the comments A = readmatrix('Trial 1.txt') or better yet, opts = detectImportOptions('Trial 1.tx...

how to load an ASCII file

Based on the sample given in the comments A = readmatrix('Trial 1.txt') or better yet, opts = detectImportOptions('Trial 1.tx...

15 Tage ago | 0

| accepted

Answered

replacing Nan with 0

The line does not work because the left part just returns a logical. isnan(auPoints(r,c)) = 0 It is similar to writing isnan...

replacing Nan with 0

The line does not work because the left part just returns a logical. isnan(auPoints(r,c)) = 0 It is similar to writing isnan...

15 Tage ago | 0

Answered

Axes labeling and over-plotting two graph having different data size

Problem is that you're using the outdated date format. Most of your issues will probably go away if you change to datetime forma...

Axes labeling and over-plotting two graph having different data size

Problem is that you're using the outdated date format. Most of your issues will probably go away if you change to datetime forma...

21 Tage ago | 1

Answered

How to shift data in a 3D plot?

You just need to pass x and y data to surf. surf(1:256, 0:255, Z)

How to shift data in a 3D plot?

You just need to pass x and y data to surf. surf(1:256, 0:255, Z)

21 Tage ago | 0

Answered

How to plot 2d & 3d contour with xy coordinates with corresponding z values?

If you had the geometry saved, e.g. as .stl file, then you could just pass some constraints to the delunayTriangulation. However...

How to plot 2d & 3d contour with xy coordinates with corresponding z values?

If you had the geometry saved, e.g. as .stl file, then you could just pass some constraints to the delunayTriangulation. However...

21 Tage ago | 0

| accepted

Answered

4 x 4 Mask to Identify Regions on Map with Highest Value

Using imresize from the image processing TB %non-overlapping (use conv2 method 'valid' for overlapping) A = imresize(Z,0.5,'b...

4 x 4 Mask to Identify Regions on Map with Highest Value

Using imresize from the image processing TB %non-overlapping (use conv2 method 'valid' for overlapping) A = imresize(Z,0.5,'b...

22 Tage ago | 1

Answered

Plotting multiple axes that are adjacent to each other

Use this FEX function https://se.mathworks.com/matlabcentral/fileexchange/27991-tight_subplot-nh-nw-gap-marg_h-marg_w

Plotting multiple axes that are adjacent to each other

Use this FEX function https://se.mathworks.com/matlabcentral/fileexchange/27991-tight_subplot-nh-nw-gap-marg_h-marg_w

22 Tage ago | 1

Answered

How can I shade the background of a timeseries plot based on another value.

You could do something like this, %some data days = 100:199; PA = repmat([0 0 0 0 1 1 1 1 1 1],1,10); %PA = 1 -> blue ba...

How can I shade the background of a timeseries plot based on another value.

You could do something like this, %some data days = 100:199; PA = repmat([0 0 0 0 1 1 1 1 1 1],1,10); %PA = 1 -> blue ba...

23 Tage ago | 0

| accepted

Answered

Extracting Numbers from a mixed string

out=regexp(b,'\d*\.?\d+','match') Your expression will fail when there are more than 1 digits before the decimal sign, as ? is ...

Extracting Numbers from a mixed string

out=regexp(b,'\d*\.?\d+','match') Your expression will fail when there are more than 1 digits before the decimal sign, as ? is ...

24 Tage ago | 0

Answered

Removing the first row in data with multiple headers

As per isakson said, use detectimportoptions to fine-tune your table import. fname = 's03_lab_base.c3d.txt'; opts = detectImp...

Removing the first row in data with multiple headers

As per isakson said, use detectimportoptions to fine-tune your table import. fname = 's03_lab_base.c3d.txt'; opts = detectImp...

24 Tage ago | 0

| accepted

Answered

How can I create a variable number of arrays and plot in the same image?

Something like this? data = readmatrix('example.txt') x = data(:,1); v = data(:,2); id = find(x == 0); im = reshape(v,id(2)...

How can I create a variable number of arrays and plot in the same image?

Something like this? data = readmatrix('example.txt') x = data(:,1); v = data(:,2); id = find(x == 0); im = reshape(v,id(2)...

24 Tage ago | 2

| accepted

Answered

Remove leading zeros from dates strings

You can use histogram() to count occurences, either with datetime or categoricals as input. dates = datetime(2010,1,12) + rand...

Remove leading zeros from dates strings

You can use histogram() to count occurences, either with datetime or categoricals as input. dates = datetime(2010,1,12) + rand...

24 Tage ago | 0

| accepted

Answered

Cannot get mod to return correct value

You could try this FEX TB by John D'Errico. https://se.mathworks.com/matlabcentral/fileexchange/22725-variable-precision-intege...

Cannot get mod to return correct value

You could try this FEX TB by John D'Errico. https://se.mathworks.com/matlabcentral/fileexchange/22725-variable-precision-intege...

24 Tage ago | 0

Answered

Changing the value of a spinner from another spinner

I'll just put it here for future reference :) Like most other objects, the slider is adjusted by changing the value field ...

Changing the value of a spinner from another spinner

I'll just put it here for future reference :) Like most other objects, the slider is adjusted by changing the value field ...

26 Tage ago | 1

| accepted

Answered

How to plot 3d from scattered dataset captured from xlsx file?

You need gridded data to use surf. You have scattered data. xyz = readmatrix('sample.xlsx'); [x,y,z] = deal(xyz(:,1),xyz(:,2)...

How to plot 3d from scattered dataset captured from xlsx file?

You need gridded data to use surf. You have scattered data. xyz = readmatrix('sample.xlsx'); [x,y,z] = deal(xyz(:,1),xyz(:,2)...

26 Tage ago | 1

| accepted

Answered

Animating a complicated 3d graph

I just made some changes to your code to show you a different way of getting a similar result. Basically, just update the ydata ...

Animating a complicated 3d graph

I just made some changes to your code to show you a different way of getting a similar result. Basically, just update the ydata ...

27 Tage ago | 0

Answered

Drawing line segments in a 3d plot

Something like this? A = rand(6,5); startv = [A(:,1),A(:,2),A(:,5)]; endv = [A(:,3),A(:,4),A(:,5)]; figure;hold on scatter3...

Drawing line segments in a 3d plot

Something like this? A = rand(6,5); startv = [A(:,1),A(:,2),A(:,5)]; endv = [A(:,3),A(:,4),A(:,5)]; figure;hold on scatter3...

28 Tage ago | 1

| accepted

Answered

How to use the same .mat files in different activities AppDesigner

You could put the content of the .mat file in a public property. Go to code view > select properties > add a public property. ...

How to use the same .mat files in different activities AppDesigner

You could put the content of the .mat file in a public property. Go to code view > select properties > add a public property. ...

etwa ein Monat ago | 0

Answered

Time plotting in MATLAB

You can delete the secondary label (undocumented property), delete(ax.XAxis.SecondaryLabel) ...but I would just plot the data ...

Time plotting in MATLAB

You can delete the secondary label (undocumented property), delete(ax.XAxis.SecondaryLabel) ...but I would just plot the data ...

etwa ein Monat ago | 0

Answered

Daily average of several years data

This will probably work [~,~,G] = unique([SST(:,1),SST(:,2)],'rows') out = splitapply(@mean,SST(:,4),G); You should end up wi...

Daily average of several years data

This will probably work [~,~,G] = unique([SST(:,1),SST(:,2)],'rows') out = splitapply(@mean,SST(:,4),G); You should end up wi...

etwa ein Monat ago | 0

Answered

how to create diagonal stripes in a specific area of plot

Try this FEX function https://se.mathworks.com/matlabcentral/fileexchange/30733-hatchfill This could also work for i = -size(...

how to create diagonal stripes in a specific area of plot

Try this FEX function https://se.mathworks.com/matlabcentral/fileexchange/30733-hatchfill This could also work for i = -size(...

etwa ein Monat ago | 0

Answered

Finding time difference that meet criteria

First make sure your data is in duration format. %making up some data t1 = (hours(10):hours(2):hours(24))'; t2 = t1 + rand(nu...

Finding time difference that meet criteria

First make sure your data is in duration format. %making up some data t1 = (hours(10):hours(2):hours(24))'; t2 = t1 + rand(nu...

etwa ein Monat ago | 0

Answered

Using Pie Charts as nodes in a plot of a graph

I was quite surprised to find a FEX function that seems to do exactly what you're looking for. You could try this: https://se.m...

Using Pie Charts as nodes in a plot of a graph

I was quite surprised to find a FEX function that seems to do exactly what you're looking for. You could try this: https://se.m...

etwa ein Monat ago | 1

| accepted