Answered
Replacing NaN with last real value
If you have R2016b or later releases, use the fillmissing function. I am not certain what you want to do, so see the method a...

7 years ago | 0

| accepted

Answered
Peak value on plot graph
If you have R2017b or later, you can use the islocalmax function. If you have the Signal Processing Toolbox, you can use the ...

7 years ago | 0

| accepted

Answered
Finding the percentage of NaN cells in columns
This does everything for all the tables in ‘C’: D = load('C.mat'); C = D.C; for k = 1:numel(C) C{k}(:,1:4) = fillmissin...

7 years ago | 1

| accepted

Answered
Import correct date and time from different columns in Excel
Try this: In = readtable('Airport 2019 (1.5-30.9).xlsx', 'PreserveVariableNames',1); hrmnsc = datetime(compose('%04d\n',In.Ti...

7 years ago | 0

| accepted

Answered
where are my data?
Try this: F = openfig('untitled.fig'); ax = gca; lines = findobj(ax, 'Type','Line'); for k = 1:numel(lines) x{k,:} = l...

7 years ago | 1

| accepted

Answered
ODE45 Unable to perform assignment because the left and right sides have a different number of element
The problem is ‘G’. Since it is a vector, all computations involving it are going to be arrays. You can use it, however in e...

7 years ago | 0

Answered
Solve system of differential equations with vector input
In the derivation, let ‘a’ simply be an undefined constant, and define the initial conditions as 0 (unless you want them to be s...

7 years ago | 1

| accepted

Answered
Is it possible to extract also R^2 value from linear fit between 2 vectors ?
It is, however polyfit wil not do it for you. Try this: x = 1:10; % Create ‘x’ y = r...

7 years ago | 2

| accepted

Answered
add the peak values of a signal to a graph regardless of number of peaks
Your code is a bit difficult to follow. Insert this text call just after the plot call for the red circles: text(picos(:,1)...

7 years ago | 0

Answered
Error using integral function
Try this instead: ALP = @(j,l,x) ((-1)^l)*(1-x*x)^(l/2)*diff(legendreP(j,x),l); syms x y alpha = 45*pi/180; b = cos(alpha);...

7 years ago | 0

| accepted

Answered
frequeny domain signal into time domain signal
The ‘outputtransmitterADS.txt’ file has dB as a function of frequency. There are two problems: First: The frequency goes f...

7 years ago | 0

Answered
Problem with if and else and else
The if conditions are incorrect. Try this instead: if (0.04<=t_1/Do) & (t_1/Do<0.05) % If condition ...

7 years ago | 1

| accepted

Answered
Obtain a transfer function form a 2nd order D.E. using the Lapalce Transforms
It is, however it takes some effort and a bit of manual intervention in the end: % d^2y(t)/dt^2 + 7.6*dy(t)/dt + 4.2*y(t) = x(...

7 years ago | 0

| accepted

Answered
Using xlsread to put info into a cell array
‘But I don't understand what the [~,~,tabel] thing does... ’ The xlsread function has three possible outputs. The tilde (~...

7 years ago | 0

| accepted

Answered
Need help for export table to excel
I am not certain what your cell array consists of. This prototype code (that appears to construct ‘C’ to match your descripti...

7 years ago | 1

| accepted

Answered
How do you calculate controllability matrix when A has non-numeric parameters?
That is possible with the Symbolic Math Toolbox, although not with the Control System Toolbox: syms A B a b B = sym('b',[2 2...

7 years ago | 0

Answered
Problems with datestr()
The problem is that 25 of ‘data_datetime’ is NaT (not a time, analogous to NaN, not a number). The datenum function cannot conv...

7 years ago | 1

| accepted

Answered
Why are the symbolic units not evaluated by a square root?
It appears that the square root is still expressed as a square root, so the units remain the same within it: omega_n = 27.42*...

7 years ago | 0

| accepted

Answered
Polyval function not working in my fatigue failure analysis problem
If you are calling polyfit as: x1 = polyfit(separateUnits(d),n,2) you need to call polyval as: v = polyval(x1,separateUnits...

7 years ago | 0

| accepted

Answered
Error using vertcat Dimensions of matrices being concatenated are not consistent
Since you have defined ‘X’ as a column vector, you likely need to vertically concatenate the ifft arguments in ’xt’ instead of h...

7 years ago | 0

Answered
While ploting in matlab
It will plot the third column of ‘x’ against the row size of ‘x’. It is essentially equivalent to: plot((1:size(x,1)), x(:,...

7 years ago | 1

| accepted

Answered
How can I store data from an excel file to a 1D vector
Use the readmatrix function (R2019a and later), or xlsread with earlier versions.

7 years ago | 0

Answered
Using for loop to calculate ode15s multiple time, store end value of each calculation
It is difficult to follow what you are doing. Note that in these lines in ‘Tuto31’: dh = y(3)*exp(-8.56-19110/T);S = ((So.^...

7 years ago | 0

| accepted

Answered
How to set slope in linear regression
Determing the statistic you want to use to determine how well the regression explains the points is not difficult. It is relati...

7 years ago | 0

| accepted

Answered
calculate a P value using a permutation test
In MATLAB, use the ranksum function. For your data: p = 0.350702223666955 h = 0 stats = zval...

7 years ago | 0

Answered
Trying to understand the format SHORT setup
Five decimal digits = one to the left of the decimal, four to the right of the decimal, and exponential notation as necessary. ...

7 years ago | 1

| accepted

Answered
How to insert legend in plot after a for cycle?
I cannot run your code, so here is a prototype you can adapt: figure hold on for i = 1:10 hpb = plot3(rand, rand, rand,...

7 years ago | 0

| accepted

Answered
ideal low-pass filter transfer function
The ‘ideal’ filter is symmetrical about the origin in the frequency domain (after doing the fftshift call), so will be 1 from -2...

7 years ago | 2

| accepted

Answered
Downsampling of RPM traces
I assume that the signal is sampled regularly, and a fixed sampling interval. Use the Signal Processing Toolbox resample func...

7 years ago | 1

| accepted

Answered
How to work out BPM from ECG data
The R-wave frequency peak should be the largest peak in the absolute value of the Fourier transform (after removing any d-c offs...

7 years ago | 0

| accepted

Load more