Answered
How can I shift my wave gauge data in time so every signal starts at the same time?
One option is the Signal Processing Toolbox <http://www.mathworks.com/help/signal/ref/alignsignals.html *|alignsignals|*> (link)...

9 years ago | 1

| accepted

Answered
How to convert a datenum to a datetime?
Use the *|'ConvertFrom'|* option: t = datetime(X,'ConvertFrom','datenum')

9 years ago | 13

| accepted

Answered
Fit Reference plot to data
If you have the data that created the *‘Ti3+’* and *‘Ti4+’* curves, do a simple linear fit to each of those with your data at th...

9 years ago | 0

Answered
Error message on if functions with two arrays
_Guessing_ here, because of the paucity of information. Consider: for i=1:N-1 instead.

9 years ago | 1

| accepted

Answered
How to make this code more efficient?
You can take advantage of the *|bsxfun|* function to do all the matrix multiplications at once. Then do the scalar multiplicati...

9 years ago | 0

| accepted

Answered
Trying to solve and plot the non-linear pendulum equation
Try this: dydt = [u; -sin(u)];

9 years ago | 0

Answered
Input Dialogue box text not breaking line
The *|sprintf|* function does this the way you want: Input = inputdlg(sprintf('%s\n%s', 'What Text or Word would you like ...

9 years ago | 2

| accepted

Answered
why the result is not decimal?
Use the *|vpa|* function or the *|double|* function.

9 years ago | 0

| accepted

Answered
Meshing of a surface plot?
Calculate *|‘z’|* _After_ defining *|‘Xm’|* and *|‘Ym’|*, and use those as the arguments: x = -1:.1:1; y = -2*pi:.1:2*p...

9 years ago | 0

Answered
getting error "Index exceeds matrix dimensions"
Try this instead: i=i+windowsize;

9 years ago | 0

Answered
Subscript indices must either be real positive integers or logicals error for very specific values.
You are seeing the effect of floating-point approximation error. See <http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_....

9 years ago | 1

| accepted

Answered
How can i calculate five unknown parameters??
Use the Optimization Toolbox <https://www.mathworks.com/help/optim/ug/fsolve.html *|fsolve|*> (link) function.

9 years ago | 0

| accepted

Answered
How to calculate moving average
Use the <https://www.mathworks.com/help/matlab/ref/movmean.html *|movmean|*> (link) function (introduced in *|R2016a|*). Yo...

9 years ago | 1

Answered
How to give each plot in a for loop a different range, depending on the figure of the plot.
If you want to find a particular peak (with particular properties) and the index or independent variable value where it occurs, ...

9 years ago | 0

Answered
How can I make an array of handles?
Using *|bsxfun|*: f = @(x,y) 3*x + 5*y; % ‘Parent’ Function ary = @(x,y) bsxfun(f, x(:), y(:)...

9 years ago | 1

Answered
best amount for my special chebyshef filter??
Calculate the <https://www.mathworks.com/help/releases/R2015a/matlab/ref/fft.html *|fft|*> (link) of your data to determine the ...

9 years ago | 0

| accepted

Answered
How to find the erro for fitted parameters?
To get parameter confidence limits on a nonlinear regression, use the <https://www.mathworks.com/help/stats/nlparci.html *|nlpar...

9 years ago | 0

| accepted

Answered
how to fix this error -> Undefined function 'eq' for input arguments of type 'cell'.
_Guessing_ here that *|‘element’|* is a cell array of some sort. Try this: element = {'L' 'R' 'C' 'E' 'L' 'R' 'C'...

9 years ago | 1

| accepted

Answered
How can I get matlab to draw lines between points?
You’re overthinking the *|plot|* call. Try this: plot(x, y, 'or-') axis([-1 1 -1 1]*2.1*r) axis equal

9 years ago | 1

Answered
Error reading size of cell array
The command works for me without error, giving the expected result of *|3 2|*. You have a variable in your workspace called...

9 years ago | 0

| accepted

Answered
Evaluating a function using the subs
If you run this: Check = x - 6*p you will see that it never evaluates to *|0|*, so the condition is never met. This is...

9 years ago | 0

Answered
Gaussian psychometric curve fit to the data
This works: x = 1:5; y = [0.97 0.89 0.5 0.08 0.03]; f = @(p,x) 1/2 * erfc ( (x - p(1)) ./ (p(2).*sqrt(2)) ); ...

9 years ago | 0

| accepted

Answered
im trying to plot this on a log log scale, with T=1000, and R = [1e-10:1e-11:1e-9]. when i get the numerical answers it works, but no lines appear when i try and plot it.
You have to vectorise every calculation involving the *|‘R’|* vector, especially the divisions: function [dnondt] = DGm(R,...

9 years ago | 0

| accepted

Answered
95% confidence interval of beta1
If you want the confidence intervals that result from *|fitlm|*, use the <https://www.mathworks.com/help/stats/compactlinearmode...

9 years ago | 0

Answered
Gaussian psychometric curve fit
Use the *|mldivide,\|* function: x = 1:5; y = [0.97 0.89 0.5 0.08 0.03]; P = [ones(size(x(:))) x(:)]\y(:); ...

9 years ago | 0

| accepted

Answered
How to call multiple functions in ode 45?
I would nest them into one function: bothfcns = @(ABP, var) [@(ABP,var) vsa(ABP,var,delta,R_la,R_sa_b,V_sa_b,R_sv,P_ic,P_v...

9 years ago | 0

| accepted

Answered
What does the following expression mean: individual(i).p = []; ?
It sets the *|‘p’|* field of the ‘i-th’ element of structure *|‘individual’|* to an empty array (denoted by *|[]|*). See th...

9 years ago | 0

| accepted

Answered
How to to filter non-uniformly sampled data?
Your approach is correct. Rather than using *|interp1|*, use the Signal Processing Toolbox <https://www.mathworks.com/help/sign...

9 years ago | 0

| accepted

Answered
Problems with fft on audios
In the plot you posted, you are plotting the real and imaginary parts of the two-sided Fourier transform. You need to plot the ...

9 years ago | 0

| accepted

Load more