Answered
Matrix dimensions must agree error.
I cannot run your code to test this. Try: if ~strcmp(parameters,{'manufacturer','test'})

8 years ago | 1

| accepted

Answered
Creating tick marks on a plot
Try this: x = 1:24; y = rand(1,24); figure plot(x, y) set(gca, 'XTick',x) ...

8 years ago | 0

Answered
change julian date to format time
I believe those are actually MATLAB *|datenum|* numbers. The years do not make sense using *|'juliandate'|* or *|'excel'|* with...

8 years ago | 1

| accepted

Answered
Having trouble filtering with an analog filter in Matlab?
You cannot implement a continuous filter with a discrete signal. A continuous filter will only work if you implement it in hard...

8 years ago | 1

Answered
exponential fit not working
If you provide a delay offset for *|‘x’|* (that is, *|‘t’|*) it will provide an acceptable fit: vfcn = @(b,x) b(1).*(1-exp...

8 years ago | 1

Answered
How can I get the standard error of each row of a matrix?
The <https://en.wikipedia.org/wiki/Standard_error *standard error*> *of the mean* (link) is defined as the standard deviation di...

8 years ago | 2

Answered
Change number display with e notation to never have decimal
Try this: x=3500000 expstr = sprintf('%2.0fe%.0f', (x*10.^floor(1-log10(abs(x))))*10, floor(log10(abs(x)))-1) e...

8 years ago | 0

| accepted

Answered
Not enough input arguments error in nlinfit
Try this: inputs = [x(:),y(:),z(:)]; my_fun = @(beta,inputs) (inputs(:,1).^beta(1) .* inputs(:,2).^beta(2) ./ inputs(:,...

8 years ago | 0

| accepted

Answered
How to plot a straight line in polar coordinate system
Try this: figure(1) polar([0 90 270; 0 90 270]*pi/180, [0 0 0; 1 1 1]*54) % Use ‘polar’ figure(2) ...

8 years ago | 4

| accepted

Answered
Take the average of a repetetive part of an array
If you want to take the *|mean|* of columns *|2|*, *|4|*, *|6|*, and so forth until the *|end|* of row *|1|*, this works: ...

8 years ago | 0

Answered
Matlab Can't Access Bandpass Filter
The <https://www.mathworks.com/help/signal/ref/bandpass.html *|bandpass|*> (link) and similar functions were introduced in *|R20...

8 years ago | 1

| accepted

Answered
Problem using ode45
Include *|‘A’|* in the argument list to *|‘lorenz’|*, then pass it as an extra parameter in your *|ode45|* call. Function: ...

8 years ago | 0

Answered
Extract a Bode Plot from a filter
Use the Signal Processing Toolbox <https://www.mathworks.com/help/signal/ref/freqs.html *|freqs|*> (link) function for continuou...

8 years ago | 2

| accepted

Answered
FFT from measured data - Scaling y-axis
Your code appears to be correct. I would change two lines: FFT=abs(fft(Timedomain,N)/L); ...

8 years ago | 1

| accepted

Answered
Transforming an integer vector into dates text vector
Assuming your original vector is numeric, there are two options: dates = [20101224; 20101225; 20101226]; ds1 = datestr(...

8 years ago | 0

| accepted

Answered
Creating a legend inside a loop, using sprintf
Try something like this: time = linspace(0, 2*pi); % Create Data beta = 1:5; ...

8 years ago | 1

| accepted

Answered
How can I deal with missing data or to interpret it in Vector MATLAB?
Try something like this: x = 0:0.1:6.3; y = [sin(x(1:20)) NaN(1,10) sin(x(31:50)) NaN(1,5) sin(x(56:end))]; yi =...

8 years ago | 0

| accepted

Answered
"Unable to perform assignment because the indices on the left side are not compatible with the size of the right side."
Please do not ever use *|global|* variables. This works: function r = rxnrate(V,F, k, Keq, f, P) Fa=F(1); Fb=F(...

8 years ago | 1

| accepted

Answered
How to plot this wave function into 2D or 3D polar coordinate?
I have no idea what you are doing. This runs, although having the correct values for the constants will likely produce bett...

8 years ago | 0

Answered
Subscript indices must either be real positive integers or logicals.
The error you are getting is most likely because you created a _variable_ named *|‘angle’|* (or possibly *|fft|*, since we do no...

8 years ago | 0

Answered
Numerical Differential Equation Matrix Form with Forcing Function
You need to make *|‘b’|* a function of *|‘t’|*, and call it appropriately in *|‘F’|*. Then it works: A = [0 1 0 0 ...

8 years ago | 1

| accepted

Answered
Why doesn't findpeaks find the peaks?
I can’t figure out what you’re doing. A straightforward ‘fix’ is to give the independent variable vector *|‘xq1’|* to *|fin...

8 years ago | 0

| accepted

Answered
Hello, I want to solve system of non linear equations using fsolve. There are thre equations and two unknowns K and L. looking at my code, please advice how to best do this. Also please advice if this is the best way or there is an alternate option.
You have the correct approach and are close to the correct solution. There are some errors in your code for *|‘calib’|* that I ...

8 years ago | 0

| accepted

Answered
Plot frequency in a histogram
I am not certain what you want. Try this: click = randi([0 1], 1, 100); % C...

8 years ago | 0

| accepted

Answered
How to find dominant frequency of a vector?
I have no idea what your signal looks like. The *|0|* Hz peak is the d-c (constant) offset. The easiest way to eliminate it is...

8 years ago | 0

Answered
How to find the peridicity contained in an image
Because of the arc, the only way to determine the periodicity may be to calculate the angles for each radial element, and then a...

8 years ago | 0

Answered
From k-space to phase plot
See if the <https://www.mathworks.com/help/matlab/ref/angle.html *|angle|*> (link) and <https://www.mathworks.com/help/matlab/re...

8 years ago | 0

| accepted

Answered
How do I Fit one differential equation with multiple variables using lsqcurvefit and ode45
See any of these: * <https://www.mathworks.com/matlabcentral/answers/43439-monod-kinetics-and-curve-fitting#comment_89455 *M...

8 years ago | 0

| accepted

Answered
How to plot function from m file with vectors
First, vectorizing will help: F = 2 * x(1).^2 - x(2).^2; Second, you are confusing *|fplot|*, since it does not know wh...

8 years ago | 0

Answered
Function file that removes a character in a string?
This replaces the hyphen with a space. You can use the loop if you want. You simply have to tweak it: n = length(str...

8 years ago | 1

| accepted

Load more