Answered
Parameter Estimation for a System of Differential Equations
Using this version of ‘kinetics’ (that also estimates the initial conditions for ‘DifEq’), function C=kinetics(k,t) c0=k(5:8)...

6 years ago | 1

| accepted

Answered
Convert Data from array
I am not certain what your data are, or what you want to do. One option for reducing the size of the array and still getting ...

6 years ago | 1

| accepted

Answered
How to find out lag between two signals ?
One option is the finddelay function. There are related functions linked to in and at the end of that documentation page.

6 years ago | 0

Answered
Matlab Function from code
See the documentation on Function Basics.

6 years ago | 0

| accepted

Answered
Index in position 2 is invalid. Array indices must be positive integers or logical values.
My guess is that the problem is using ‘Y(iter)’ and ‘K(ik)’ as indices in that assignment. They may not be integers greater tha...

6 years ago | 1

Answered
Accessing values in a Cell Array using Index Values stored in another array
That requires a bit of cell array gymnastics: NewVector = [1.5 1.5 2.1 2.2 2.2 2.2 2.2 0.9 0.8 2.4 2.3 2.8 2.4 2.9 3.1]; New...

6 years ago | 0

| accepted

Answered
How to reshape an array horizontally
Using the reshape function: text1 = ['words'; 'words'; 'words'] text2 = reshape(text1', 1, []) producing: text1 = 3×5...

6 years ago | 2

| accepted

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
Subscript the vectors in the loop that calculates the new values: for i=1:nIterations-1 S(i+1)= S(i)-dt.*(h.*S(i)+rho.*I(...

6 years ago | 2

| accepted

Answered
How to plot a values inside a while loop .
The easiest way is to store the intermediate results, then plot them at the end: while t<176400 H=3600; fprintf('\t\...

6 years ago | 0

Answered
taking samples from a vector
Try these: D = load('psi.mat'); psi = D.psi; % (10962 x 1) Every5 = psi(1:5:end); ...

6 years ago | 2

| accepted

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); ...

6 years ago | 1

| accepted

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...

6 years 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; % ...

6 years 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...

6 years 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) ...

6 years 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...

6 years ago | 1

| 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)...

6 years 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...

6 years ago | 1

| accepted

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...

6 years 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 = ...

6 years 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: ...

6 years ago | 1

| 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...

6 years 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’ ...

6 years 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. ...

6 years 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...

6 years 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; ...

6 years 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...

6 years ago | 0

| accepted

Answered
Convert data plot from Cartesian to spherical coordinates
See if the cart2sph function will do what you want.

6 years 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...

6 years 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...

6 years ago | 0

| accepted

Load more