Answered
Musical Note Filter & Fundamental Frequency
If you want examples of filtering, I’ve posted several over the years. One recent example is I need help building bandstop filt...

7 years ago | 1

| accepted

Answered
Joining all y-axis points by a smooth line
Try this: y = linspace(1.2, 3, 50); x = sin(2*pi*y)*2000; figure plot(x, y, '-o') grid It would be easier if we had you...

7 years ago | 0

| accepted

Answered
Non-linear curve fitting
You need to define your model function as a function, then use some optimization function to fit the parameters. Example: y...

7 years ago | 0

| accepted

Answered
drawing square sinusoidal functions
Just for fun, other options are: t = linspace(0,10,250); f = 100; sqwv = sum(sin(2*pi*(1:2:27)'*t*f)./((1:2:27)')); figur...

7 years ago | 1

Answered
How to plot dates expressed in the form of number?
Try this: plot(Time,Values) datetick('x','yyyy/mm/dd') Experiment to get the result you want. You can also transform them...

7 years ago | 0

Answered
How to extract the numerial values out of readtable output?
It is possible, although not without some serious conniptions. Originally: AA_Table = readtable('AA.xlsx'); headers = AA_...

7 years ago | 1

| accepted

Answered
xlsread error: Array indices must be positive integers or logical values.
I was able to read your file without error. However, if you have R2013b or lalter release, the readtable (link) function is l...

7 years ago | 0

| accepted

Answered
How to use my numeric array results as input values for an ODE?
Try this: n = 10 ; result = zeros(n,5 ); for k=1:n ; A0=1;P0=29;g=rand;p=rand;B=rand ; result(k,:) = [A0,P0,g,p,B ]; ...

7 years ago | 1

| accepted

Answered
fzero function is returning initial value rather than finding zero.
It seems that fzero is having problems with the symbolic part of your function. If you first create it as a separate anonymnous...

7 years ago | 0

| accepted

Answered
how to split data
Another option: M = reshape(rx(1:2*fix(numel(rx)/2)), fix(numel(rx)/2), []); x = M(:,1)' y = M(:,2)' This automatically dis...

7 years ago | 0

Answered
Got new CMP. How to transfer?
I would just Install the new (R2019a) version. Definitely go to your account, because if you have already used all the activa...

7 years ago | 0

Answered
How to simplify this If command?
Use the any (link) function. Example: for i = 1:36 if any(i == 1:3:36) fprintf('1 = %d\n',i) end end i...

7 years ago | 0

| accepted

Answered
How to subtract all the row elements in a matrix
One approach: Out = A(:,1) - sum(A(:,2:end),2) producing: Out = 527307 581519 612957 631012 ...

7 years ago | 0

Answered
Accessing data from cells inside of cells
There is no guarantee that the row lengths of each ‘x’ are going to be the same using a two-element ‘tspan’ vector, so what you ...

7 years ago | 1

| accepted

Answered
Estimate parameters of TF (combination of R and C) using experimental frequency domain data (frequency, magnitude and phase)
Use the tfest (link) function in the System Identification Toolbox. You will most likely need to begin with the idfrd (link) fu...

7 years ago | 0

Answered
Numerical Integration of function with many parameters
Use the 'ArrayValued' (link) name-value pair: Mycp = [0 10]; L = 1; r = 0.03; fun = @(t,Mycp,L,r)Mycp*L*exp(-r*t); n = int...

7 years ago | 1

| accepted

Answered
Integrating velocity to get energy dissipated
If you have a vector of data for , use the cumtrapz (link) function.

7 years ago | 0

Answered
How to create an output of a vector by operating on individual elements for different conditions
Any illustration with your vectors would amount to doing this for you, and since this seems to be a homework problem, we only gi...

7 years ago | 0

| accepted

Answered
How could I use: trapz(x,y) to solve this problem
That depends on the information you have. If you have the coordinates for the upper and lower parts of the curve, use trapz on ...

7 years ago | 0

| accepted

Answered
Calculating a seperated sum from a vector.
If you want to sum consecutive blocks of elements, no explicit looop is necessary. You can just use the reshape (link) function...

7 years ago | 0

| accepted

Answered
How to find the sampling frequency of a Raman signal
Since frequency is approximately the inverse of the wavelength (actually the velocity of propagation divided by the wavelength),...

7 years ago | 0

Answered
Lines will not plot
You appear to be plotting points. You need to call hold before the outermost loop: figure hold all for L = [3 4 6] % m t...

7 years ago | 0

Answered
How to find the coordinate of the intersection multiple lines
Interesting Friday afternoon problem! The solution is reasonably straightforward, although not immediately obvious. The ‘Row...

7 years ago | 0

| accepted

Answered
how to plot normalised histogram with specific number of bins?
Try this: figure histogram(class_1, 500, 'Normalization','probability')

7 years ago | 1

| accepted

Answered
Solving equation with four unknowns
You need to explore the solutions in detail: aa=1.5; m=(0.5)^(aa); syms x y w z z1 z2 S=solve([x^2+y^2+z^2+w^2==m, x+y+z...

7 years ago | 0

| accepted

Answered
How to define a piecewise anonymous function
You need to use ‘logical indexing’: piecewise_function = @(x) (x.^2+x) .* ((0<x) & (x<1)); x = linspace(-1, 2); figure pl...

7 years ago | 11

| accepted

Answered
Undefined function 'matlabFunction' for input arguments of type 'double'.
The argument in ‘H4_b’ is not a function of anything. Inserting this line just before the ‘H4_b’ assignment: H4_b_query = c...

7 years ago | 0

| accepted

Answered
Failure in initial objective function evaluation. FMINCON cannot continue. (Not enough input arguments)
The objective functions for the optimization routines take only one input, that being the parameter vector. You can pass other ...

7 years ago | 1

| accepted

Answered
Lines in plot overlaying axis
You may have turned off the 'Clipping' (link) property of the axes. Try this: set(gca, 'Clipping','on')

7 years ago | 0

Answered
How can I solve for this system ODEs?
Your code has almost done everything you want. You just need to call the ODE solver correctly. (Your system is ‘stiff’, so I c...

7 years ago | 1

| accepted

Load more