Answered

String to Datenum Format using opts and Setvaropts

Try reading those in as strings, then doing the conversion later: t = repmat('20200721T145002Z', 5, 1); ...

String to Datenum Format using opts and Setvaropts

Try reading those in as strings, then doing the conversion later: t = repmat('20200721T145002Z', 5, 1); ...

3 days ago | 0

Answered

specifying the horizontal linetype '_' produces an error.

Function arguments in MATLAB are positional, so it is necessary to provide values for the interventing arguments to use later ar...

specifying the horizontal linetype '_' produces an error.

Function arguments in MATLAB are positional, so it is necessary to provide values for the interventing arguments to use later ar...

3 days ago | 0

Answered

Shade the region above the graph

Try this: % Maximum speed rho = 0.002378; % at sea level Vmax = 987.48; K = 0.0397887; rho30 = 0.00089; rhos = 0.374; % ...

Shade the region above the graph

Try this: % Maximum speed rho = 0.002378; % at sea level Vmax = 987.48; K = 0.0397887; rho30 = 0.00089; rhos = 0.374; % ...

3 days ago | 0

Answered

How do I filter out unwanted frequencies from an audio file?

It would appear that the ‘mirror image’ refers to the complex double-sided Fourier transform. In addition to fft, you will li...

How do I filter out unwanted frequencies from an audio file?

It would appear that the ‘mirror image’ refers to the complex double-sided Fourier transform. In addition to fft, you will li...

3 days ago | 0

| accepted

Answered

More than one frequencies

Multiply the two tones (modulate the 440 Hz with the 400 Hz) to get the ‘beat’ effect you want: sound(s, Fs) ...

More than one frequencies

Multiply the two tones (modulate the 440 Hz with the 400 Hz) to get the ‘beat’ effect you want: sound(s, Fs) ...

3 days ago | 0

| accepted

Answered

How to graph a function with a parameter that changes with time.

It is straightforward to define and calculate the result of ‘y’ while varying both ‘t’ and ‘x’ at the same time, using matrix ar...

How to graph a function with a parameter that changes with time.

It is straightforward to define and calculate the result of ‘y’ while varying both ‘t’ and ‘x’ at the same time, using matrix ar...

4 days ago | 0

| accepted

Answered

How to scale an axis on a plot in powers of 10?

Set xlim to the limits you want. Example — x = logspace(5, 6, 25); % Create Data y = rand(size(x)...

How to scale an axis on a plot in powers of 10?

Set xlim to the limits you want. Example — x = logspace(5, 6, 25); % Create Data y = rand(size(x)...

4 days ago | 0

| accepted

Answered

ODE solvers - passing parameters

It is actually a bit more involved than simply passing parameters when you are using the function with any of the ODE solvers (o...

ODE solvers - passing parameters

It is actually a bit more involved than simply passing parameters when you are using the function with any of the ODE solvers (o...

4 days ago | 0

Answered

How can I to convert a cell to a double without losing the leading zeros?

Thank you for quoting my code from Extracting numbers from mixed string ! It is not possible to retain leading zeros in a num...

How can I to convert a cell to a double without losing the leading zeros?

Thank you for quoting my code from Extracting numbers from mixed string ! It is not possible to retain leading zeros in a num...

5 days ago | 0

| accepted

Answered

Extracting numbers from mixed string

Another approach: str = 'preci_CZ_02000_20200101_0000.txt'; out = regexp(str, '(?:\d{4})\>','match'); producing: out = ...

Extracting numbers from mixed string

Another approach: str = 'preci_CZ_02000_20200101_0000.txt'; out = regexp(str, '(?:\d{4})\>','match'); producing: out = ...

5 days ago | 0

Answered

How can I plot two datasets together if they have different x axis values?

The ‘data.mat’ file contains data for only one day as datenum values, that apparently are all for 01-Jan-2020. One approach: ...

How can I plot two datasets together if they have different x axis values?

The ‘data.mat’ file contains data for only one day as datenum values, that apparently are all for 01-Jan-2020. One approach: ...

5 days ago | 0

| accepted

Answered

Highlight Specific Portion of Graph

I am not ccertain what you want to highlight, since that region is vanishingly small. Try this: %Emissive Power wl=10e-2:0...

Highlight Specific Portion of Graph

I am not ccertain what you want to highlight, since that region is vanishingly small. Try this: %Emissive Power wl=10e-2:0...

5 days ago | 0

| accepted

Answered

I want to sketch the parametric euqations lies on the cone, but the cone is so small and the lines are sparser than it should be.

Scale the size of the cone up by multiplying its variables with some appropriate constant (that I call a ‘Magnification Factor’ ...

I want to sketch the parametric euqations lies on the cone, but the cone is so small and the lines are sparser than it should be.

Scale the size of the cone up by multiplying its variables with some appropriate constant (that I call a ‘Magnification Factor’ ...

5 days ago | 0

| accepted

Answered

Getting a function I downloaded online to run

First, use dir on the folder to be certain it actually appears there. Second, see what: which('intpartition.m') returns. ...

Getting a function I downloaded online to run

First, use dir on the folder to be certain it actually appears there. Second, see what: which('intpartition.m') returns. ...

5 days ago | 0

Answered

How to apply bandpass filter to a single data type?

Yes. You can use single. See the documentation section for x . This specifically refers to the Signal Processing Toolbox b...

How to apply bandpass filter to a single data type?

Yes. You can use single. See the documentation section for x . This specifically refers to the Signal Processing Toolbox b...

5 days ago | 0

| accepted

Answered

glmfit not working: US's chances of recession

Use glmval to evaluate the result of the fit: T1 = readtable('USREC.xls'); ind = T1.ind; us2y10 = T1.us2y10; rec = T1.rec; ...

glmfit not working: US's chances of recession

Use glmval to evaluate the result of the fit: T1 = readtable('USREC.xls'); ind = T1.ind; us2y10 = T1.us2y10; rec = T1.rec; ...

6 days ago | 0

| accepted

Answered

Why won't this plot?

The problem are the y-axis limits in the axis call. Comment-out the axis call (as I do here) and you will immediately see the...

Why won't this plot?

The problem are the y-axis limits in the axis call. Comment-out the axis call (as I do here) and you will immediately see the...

6 days ago | 0

| accepted

Answered

Convert data plot from Cartesian to spherical coordinates

See if the cart2sph function will do what you want.

Convert data plot from Cartesian to spherical coordinates

See if the cart2sph function will do what you want.

6 days ago | 0

| accepted

Answered

Even binned histogram to uneven bins?

If you are using the histogram function, you can specify the bind widths using the edges option. See Specify Bin Edges of Histo...

Even binned histogram to uneven bins?

If you are using the histogram function, you can specify the bind widths using the edges option. See Specify Bin Edges of Histo...

6 days ago | 0

Answered

How do I troubleshoot if a plot line doesn't show up on a figure

It plots a horizontal dotted line at 55 from 0 to 7. If it works independently, then there are several possibilities, some of...

How do I troubleshoot if a plot line doesn't show up on a figure

It plots a horizontal dotted line at 55 from 0 to 7. If it works independently, then there are several possibilities, some of...

6 days ago | 0

| accepted

Answered

How to make while loop faster ?

First, the number of iterations is going to be: n_iter = 1/D_1 evaluating to: n_iter = 6.666666666666667e+12 That is...

How to make while loop faster ?

First, the number of iterations is going to be: n_iter = 1/D_1 evaluating to: n_iter = 6.666666666666667e+12 That is...

6 days ago | 0

Answered

Genetic Algorithm: undefined function or method for input arguments of type' double '.

The fitness function needs to accept arguments, and (in general) needs to return a scalar result. That will likely require that...

Genetic Algorithm: undefined function or method for input arguments of type' double '.

The fitness function needs to accept arguments, and (in general) needs to return a scalar result. That will likely require that...

6 days ago | 0

Answered

How to make a plot from for loop where the results are a 3x1 matrix?

Try this slight variation on your code: s=300; r=25; k=30; kukat=[s;r;k]; A=[0.23 0 233;0.74 0.52 0;0 0.35 0.46]; a=15; ...

How to make a plot from for loop where the results are a 3x1 matrix?

Try this slight variation on your code: s=300; r=25; k=30; kukat=[s;r;k]; A=[0.23 0 233;0.74 0.52 0;0 0.35 0.46]; a=15; ...

6 days ago | 0

| accepted

Answered

Finding different length pulses

Note that ‘clean them up’ is ever so slightly ambiguous. Assuming that the objective is to remove some of what might be consi...

Finding different length pulses

Note that ‘clean them up’ is ever so slightly ambiguous. Assuming that the objective is to remove some of what might be consi...

6 days ago | 0

| accepted

Answered

Building Low-pass filter with Sinc function

I am not exactly certain what the problem is from a theoretical prespective (I will leave it to you to explore that), however th...

Building Low-pass filter with Sinc function

I am not exactly certain what the problem is from a theoretical prespective (I will leave it to you to explore that), however th...

6 days ago | 0

| accepted

Answered

Why didn't I get an error for my matrices?

You are seeing ‘Automatic Implicit Expansion’ introduced in R2016b (much to the consternation of many of us). Previously, the o...

Why didn't I get an error for my matrices?

You are seeing ‘Automatic Implicit Expansion’ introduced in R2016b (much to the consternation of many of us). Previously, the o...

6 days ago | 0

Answered

How do you plot the phase and amplitude of a complex function?

to calculate the amplitude, use the abs function. For the phase, use the angle function.

How do you plot the phase and amplitude of a complex function?

to calculate the amplitude, use the abs function. For the phase, use the angle function.

7 days ago | 1

Answered

How to plot spectral density given a column of data?

My guess is that there is a significant d-c (constant) offfset. This is the mean of ‘x’, and will show up as the amplitude at ...

How to plot spectral density given a column of data?

My guess is that there is a significant d-c (constant) offfset. This is the mean of ‘x’, and will show up as the amplitude at ...

7 days ago | 1

Answered

Issues with entering into MATLAB

This sems to be homework. Vectorise the expoinentiation: y= (2*x.^1.01)+ sin(3*pi/2 *x)-10*cos(x)-3; ↑ ← HERE Th...

Issues with entering into MATLAB

This sems to be homework. Vectorise the expoinentiation: y= (2*x.^1.01)+ sin(3*pi/2 *x)-10*cos(x)-3; ↑ ← HERE Th...

7 days ago | 0

| accepted

Answered

How to solve ODEs with time dependent parameters by ode45 method

I do not see any interp1 calls in the code you posted. To use a function in a calculation, the function needs to be evaluated...

How to solve ODEs with time dependent parameters by ode45 method

I do not see any interp1 calls in the code you posted. To use a function in a calculation, the function needs to be evaluated...

7 days ago | 0

| accepted