Answered
Comparison two curves (functions)
Use interp1 — x = linspace(1, 20, 30); y = tanh(x-12-rand)*2.5; x0 = interp1(y,x,0) figure plot(x,y, x0,0,'+r', 'Marke...

4 years ago | 0

Answered
How to average data per hour ?
Transpose it so that the columns are rows, create it as a timetable and then use the retime function specifying 'hourly','mean'....

4 years ago | 0

| accepted

Answered
How to integrate besselk function with variable limits?
One option is to use the arrayfun function to do the integration (essentially a one-line implied for loop) — % double x; y=0:...

4 years ago | 1

| accepted

Answered
Printing a message inside a function
Use either: sprintf('%s has finished running',file1) or: fprintf('\n%s has finished running\n',file1) depending on the res...

4 years ago | 0

| accepted

Answered
How can I estimate transfer function from frequency data?
The best way to see how well the estimated system fits the data is to use the compare function. Change (increase) ‘np’ using...

4 years ago | 0

Answered
is it possible to multiply 2 symbolic polynomials?
The easiest way to find out is to do the experiment — syms x f=[34 43 5] %and h=[32 34 4] % i can use the (conv command...

4 years ago | 3

| accepted

Answered
copy and paste datas from two Arrays into one
At leasty two options for this — A = [3 4 6]; B = [5 7 9 11 14 17]; C = [A; B] C = cat(1,A,B) .

4 years ago | 0

Answered
How do i count the signal within a certain time interval?
One option is to use the movsum function, and then threshold the result — t = linspace(0, 100, 100); s = rand(100,1)>0.80; ...

4 years ago | 1

| accepted

Answered
How can I falsely increase the frequency of acquisition of a signal?
I do not clearly understand what you want to do. However, if you want both signals to have the same sampling frequency, use t...

4 years ago | 0

| accepted

Answered
Parsing .txt File with Unique Format
This will read it successfully — fidi = fopen('sample.txt','rt'); k1 = 1; while ~feof(fidi) C = textscan(fidi, repmat('...

4 years ago | 2

| accepted

Answered
How to conversion of Acceleration FFT to Velocity?
Perhaps something like this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/994900/fantest.xl...

4 years ago | 0

| accepted

Answered
FFT of vibration data, Help me please.
Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/994895/fantest.xlsx%20-%20Sheet2.xls...

4 years ago | 0

| accepted

Answered
Plotting poles and zeros
I am also wondering, however I am reasonably confident that ‘b’ and ‘a’ are not derived from a Control System Toolbox tf functio...

4 years ago | 0

Answered
Can't figure out why my ODE solver is producing a straight line
It plots a straight line because all the initial conditions arre zero. Add eps (or some small, non-zero value) to them, and i...

4 years ago | 0

| accepted

Answered
how to find the intersection points of two 3d surfaces
Try this — fcn = @(Lambda,V) [2.0346941376982715 + (0.33000000000000007 - 0.5 * V); (1./Lambda).^0.9523809523809523]; % wher...

4 years ago | 0

Answered
How to work with categorical or "cell" variables within a table?
Converting the ‘Date’ and ‘Time’ variables to datetime arrays is straightforward, however it is not obvious. Try this — T1 ...

4 years ago | 1

| accepted

Answered
Extract data from a bode plot.
s = tf('s'); HLM = ((2.524e-06)*s^3 + 37.11*s^2 + 37.6*s)/((2.704e-07)*s^3 + 1.767*s^2 + 41.36*s + 80); Finf = 1e-3; %Hz Fs...

4 years ago | 1

Answered
substract an element from previous element in a matrix
The diff function seems to be appropriate.

4 years ago | 0

Answered
Plot level curves and projections as a contour
I am not certain what result you want. The contour3 function or surfc could be an option — N1 = 10; N2 = 10; x1 = linspac...

4 years ago | 0

| accepted

Answered
ODE45 needs column vector from anonymous function
Do element-wise division: yprime = @(x,y) ((-x.*y)./(sqrt(6-(y.^2)))); ↑ and it does — options = o...

4 years ago | 0

Answered
Error using mesh, Z must be a matrix, not a scalar or vector.
In figure(3) the code needs to be: [tt,xx]=meshgrid(t1,x); mesh(xx,tt,T) The problem was using ‘t’ instead of ‘t1’ and using...

4 years ago | 0

| accepted

Answered
sub2ind - understanding question
The graphic explanation in Examples explains how MATLAB stores and addresses matrices using both linear indexing and subscripts....

4 years ago | 0

Answered
How to plot this function with the interval of [-2,2]?
Use fimplicit — syms x f(x) = x + 1 - 2*sin(pi*x) figure fimplicit(f, [-2 2]) grid xlabel('x') .

4 years ago | 0

Answered
Find zero crossings in each row of a matrix (321 x 123 double)
t = linspace(0, 5, 123); % Create Data A = sin(randi(9,5,1)*2*pi*t/5 + 2*pi*randi(9,5,1)) ...

4 years ago | 0

| accepted

Answered
How to plot this equation?
syms t y f(t,y) = 2*y/t - (t*y)^2 figure fsurf(f, [-5 5 -5 5]) xlabel('t') ylabel('y') zlabel('f(t,y)') It is nec...

4 years ago | 0

Answered
Plotting phase space for 2nd order nonlinear ODE
I am not certain what you want to plot for the phase plot. This calculates and plots as a funciton of and also calculates t...

4 years ago | 1

| accepted

Answered
How to plot graph?
Try this — Ax = gca; Ax.YAxis.Exponent = 0; I checked, and this will work in R2018a according to the R2018a NumericRuler Pro...

4 years ago | 0

| accepted

Answered
How do i plot the phase of fft values in a matrix?
Use the angle function to calculate the phase from the complex fft result. The unwrap function may also be helpful, depending o...

4 years ago | 1

Answered
How to optimize an objective function with repect to two variables using fmincon?
The general approach to maximising a function is to negate it so the minimum that the optimisation functions find is actually th...

4 years ago | 1

| accepted

Answered
Find boundary of curve-forming points
This is not perfect, however it is the best I can do with these data — LD = load('data.mat'); beta = LD.beta; r = abs(beta...

4 years ago | 0

Load more