# Dave B

### MathWorks

I am a software engineer at MathWorks. My work focuses on graphics and charting.

**Statistics**

RANK**130**

of 244 164

REPUTATION**738**

CONTRIBUTIONS

**0** Questions

**238** Answers

ANSWER ACCEPTANCE **
0.00%
**

VOTES RECEIVED**63**

RANK**13 772** of 17 069

REPUTATION**9**

AVERAGE RATING**5.00**

CONTRIBUTIONS**2** Files

DOWNLOADS **15**

ALL TIME DOWNLOADS**54**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

How to play a note

The Note you made is a logical: you're asking where abs(t) is less than or equal to (a bunch of stuff) If you want to play th...

environ 9 heures ago | 0

How can I obtain a certain value from the function 'find' from a 3x2 cell?

I think you're asking how to search for the index of a row in a matrix based on multiple columns (although you have a cell array...

environ 10 heures ago | 0

prevent shaded areas from changing the colors of the bars.

First, you'll want the patch behind the bars, so call patch first. You can keep the transparency on the patch, but if you don't...

environ 12 heures ago | 0

Convert Cell Array into equation

I think you could use a combination of cellfun (to run on each cell) and eval (to evaluate the expression): a=readtable('matl...

environ 13 heures ago | 1

Error: This statement is incomplete.

MATLAB won't distribute your j to all the locations in your print string, so you need a few more js. Have a look without the eva...

environ 13 heures ago | 0

| accepted

programme matlab pour calculer et trace l'histogramme d'une image

im=imread('peppers.png'); % exemple d'image imshow(im) Si vous avez Image Processing Toolbox: figure imhist(im) Autrement...

environ 23 heures ago | 0

A question about ismember function

Check out the documentation page here: https://www.mathworks.com/help/matlab/math/array-indexing.html (Indexing with Logical Val...

1 jour ago | 0

| accepted

My mesh grid is giving me a value not a matrix

The question is: how many points do you want in your grid? The : operator, by itself, takes increments of 1: 5:10 The min a...

1 jour ago | 0

Discrepancy between datenum and datetime?

This is one of the many reasons we have datetime, and why we recommend using datetime instead of datenum. If you can use datetim...

1 jour ago | 0

xlabel not working inside a function

You've named the function's parameters xlabel and ylabel. So within the function xlabel and ylabel are variables, not functions....

1 jour ago | 0

| accepted

Connect datapoints in Plot

Unfortunately, not all plotting functions accept table variables in MATLAB yet (scatter was one of the first of the 'traditional...

2 jours ago | 0

| accepted

drawrectangle draws rectangle even though the mouse is clicked outside the parent UIAxes

You can pass in a DrawingArea to drawrectangle which will constrain the rectangle to the image. That keeps the drawn rectangles ...

3 jours ago | 0

Combining Graphs into one Figure

The command figure makes a new figure, so just remove the second call to figure and you should be in good shape! %% Part 1 ...

3 jours ago | 0

What is the exact reason of this error? I am not getting it. Any help will be appreciated.

As @Mathieu NOE points out, there's something a little strange in your col_headers = line. This line has a bunch of extra charac...

4 jours ago | 0

Merging three 3D plots into one

You can copy the surfaces from each of the axes, in each of the figures that you open like this: a=open('BandL_my_replication_v...

4 jours ago | 0

| accepted

Issues with greyscale png images in matlab

This looks like the result of loading an indexed image, you can read the colormap using the second output of imread: [img,cmap]...

4 jours ago | 0

| accepted

My line plot is not showing

Did you want to plot 1:Ns vs p (without the i)? plot(1:Ns,p)

4 jours ago | 0

| accepted

How to combine multiple images into an array

You can convert a 'greyscale' RGB image to a 2D image in a few ways. For instance: you could just take one channel (like the red...

4 jours ago | 0

| accepted

Multiple 3D trajectories displayed on same axis

There's a typo in your code: x1_2 = rmmissing(x1); y1_2 = rmmissing(y1); z1_2 = rmmissing(z1); x2_2 = rmmissing(x1); y2_2 =...

4 jours ago | 0

| accepted

Incomplete Normal Distribution Plot on MATLAB

The function normpdf(x,mu,sigma) will return the pdf of the normal distribution with mean mu and standard deviation sigma, evalu...

4 jours ago | 0

How can I calculate log10(variable) ??? there is error..

Assuming you've defined your variable and it's numeric, this should work: variable=100; log10(variable) x=[100 200 500 1000];...

4 jours ago | 0

| accepted

Convert Python time to Matlab datum

Python has several ways it represents time. A common one is so called unix timestamps, which are the number of seconds since 197...

7 jours ago | 1

| accepted

error when using datetime()

Does it work if you add str2double? like this: S.date = datetime(S.Year, S.Month, str2double(S.Day), 0, 0, 0, 'Format', 'uuuuMM...

7 jours ago | 0

| accepted

How can I build a matrix with an increasing number of terms in each row?

You can't have a matrix with a different number of elements on each row, but if you wanted the sums 1, 1+2, 1+2+3,... (as you de...

7 jours ago | 0

| accepted

Call fields from a struct

I'm a little confused, but I'll venture some guesses.... Do you have a struct init in your workspace (where you're calling th...

7 jours ago | 0

surf command doesn't plot the value next to NaNs values

If you think of surf as defining a bunch of little rectangles, when one vertex is missing you can't draw the rectangle. Your d...

7 jours ago | 1

| accepted

Printing cell array with skipping a value

If you want to get rid of just the one value, how about setting it to empty inside of matComp. Note that you'll end up with one ...

8 jours ago | 0

| accepted

tiledlayout not forming figures as intended

Just pasting my comment in the answer in case it may help someone else, it struck me as strange that there was a hold on before ...

8 jours ago | 0

Specifying a sample of data from a table

This sounds like a pretty broad topic, how to index things in MATLAB. You might be interested in this documentation page abou...

8 jours ago | 0

How to save a figure of a specific size with exportgraphics

you created a tiledlayout in one figure, set some of its characteristics but didn't add anything to it. Then you created a new f...

8 jours ago | 0

| accepted