Answered
How to filter a sensor-measured signal to its theoretical form
Using the results of the fft, a highpass cutoff frequency of ‘0.02*Fs’ appears to be appropriate — T1 = readtable('https://w...

4 years ago | 0

| accepted

Answered
Creating table with scalars in one column and vectors in another
Try something like this — theta = [30; -15]; Dm = [1 0 -1; 0 0 -1]; Data = table(theta, Dm) .

4 years ago | 0

| accepted

Answered
why it shows no curve in this code?
The reason no plot appears is that ‘y’ is a single point, and the plot function only draws lines between pairs of points and wil...

4 years ago | 0

| accepted

Answered
Check for incorrect argument data type or missing argument in call to function 'isfinite'.
Change ‘eqs’ to be a funciton one one argument, and it works — c=8; x=9; y=10; f=@(x,y)(f1(x,y,c)+f3(x,y,c)); ff=@(x,y)f2(...

4 years ago | 0

Answered
How to detect rotation in a trajectory?
I would use the gradient function to calculate the numerical derivative. For example: dydx = gradient(y) ./ gradient(x); P...

4 years ago | 0

| accepted

Answered
Symbolically solving vectors simultaneously
One solve statement (such as in the original post) also fails in R2022a. One option to get all of the solutions is arrayfun tha...

4 years ago | 0

| accepted

Answered
How can I merge multiple cells in one row?
Try this — cell_1 = {'date', 'year', 'place'}; cell_2 = {'name', 'age', 'time'}; firstpass = cellfun(@(x)sprintf('%%d_%s',x)...

4 years ago | 1

| accepted

Answered
Not Enough Input arguments error
I suspect the problem is the ‘input’ variable, since input is a function. The solution is to rename ‘input’ to something else...

4 years ago | 0

| accepted

Answered
Fitting 4 parameters with constraints
‘But the problem is that I need to add constraints to my parameters. This is not possible using lsqcurvefit.’ Yes, it is, how...

4 years ago | 1

| accepted

Answered
How to find the probability of something from an underlying exponential distribution?
The expcdf function will be useful here. There are examples in the documentation.

4 years ago | 1

| accepted

Answered
Why does the plot of the EMG signal change like the picture when the band pass filter is applied?
The largest difference is the elimination of the baseline offset and baseline variation (‘drift’), since these are all between 0...

4 years ago | 1

| accepted

Answered
Reversing a part of matrix
A few examples of a robust approach — M=[10 20 30 40 50 60 70 80 90 100]; i=sort(randsample(10,2)) M_new = [M(1:i(1)-1) flip...

4 years ago | 0

| accepted

Answered
Triple integral of symbolic function
Try this — syms phi r theta r0 r1 phi0 phi1 theta0 theta1 sympref('AbbreviateOutput',false); func(r,phi,theta) = r.^2.*sin...

4 years ago | 0

Answered
How can I compute the mean of a cell matrix with different size ?
Try something like this — R = {rand(10,8)} Rmeanc = cellfun(@mean,R, 'Unif',0) Rmeanv = Rmeanc{:} .

4 years ago | 0

| accepted

Answered
For loop, Brace indexing is not supported for variables of this type.
The ‘All_Values’ matrix is not a cell array, so you cannot use cell array indexing for it. (I am not exactly certain what it co...

4 years ago | 0

| accepted

Answered
i keep getting an error for the messagebox.
The ‘name’ variable is a cell array, so it must be addressed as such. Also, fprintf is not appropriate here, however sprintf is...

4 years ago | 0

| accepted

Answered
how to store the conditional loop data
If I understand the code correctly, it can be simply stated as: ut=rand(15,1); u_y=([0.84;0.384;0.784]); U_y = [u_y;u_y;u_y;...

4 years ago | 1

| accepted

Answered
How to graph this text file
The ‘A’ variable is actually the assigned file identification number, always a scalar. It us used to refer to the file using fs...

4 years ago | 0

| accepted

Answered
How to import information from an excel file with many spreadsheets
The ‘data’ output needs to be saved as a cell array for each value of ‘i’. Try something like this — num_sheets = 24; for ...

4 years ago | 0

Answered
How to interpolate the given plot?
MATLAB reads what it is given. %step 0 Qi = readmatrix("JD_PM sampleData30mm.csv"); [v,w] = size(Qi); %step 1 fCom_004 = ...

4 years ago | 1

| accepted

Answered
I am getting a "Index exceeds the number of array elements (1)." error
I have no idea what size ‘A’ is, however the sum of one element of a matrix or vector is simply that element. If the sum ca...

4 years ago | 0

| accepted

Answered
Fopen returning "Unable to find file. Ensure file exists and path is valid"
I am not certain what the problem is. Try this — currentdate = string(datetime('now', 'Format','dd/MM/yyyy')); %converst ti...

4 years ago | 0

| accepted

Answered
ODE code is not working
Problem: [VF, Subs] = OdeToVectorField ([Ode1, Ode2,Ode3]); ↑ Try this — syms X(t) Y(t) Z(t) YF alpha beta ga...

4 years ago | 0

Answered
Smaller frequency bins after FFT for PPG signal
For a one-sided fft, the frequency vector will extend from 0 Hz (DC) to 12.5 Hz (Nyquist frequency) for your signal. The length...

4 years ago | 2

| accepted

Answered
Smallest interval in array
I am not certain what the desired result is here. Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answer...

4 years ago | 0

| accepted

Answered
Need to implement a parameter that grows at a specific rate over time
Perhaps this — G0 = 2; I0 = 0.3; Gfcn = @(t,G,I) G.*(1+I).^t; t = linspace(0,5, 25); figure plot(t, Gfcn(t,G0,I0)) g...

4 years ago | 0

Answered
How to set a string as a CODE in script file?
I am not certain what you are actually asking. If you want the user to enter specific values and assign them in the code to s...

4 years ago | 0

Answered
3D plot using time series
results = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/980365/results.xlsx', 'VariableNamingRule'...

4 years ago | 0

| accepted

Answered
How to campare signals with different length?
One option may be the Signal Processing Toolbox findsignal function (introduced in R2016b). The signal lengths are not importan...

4 years ago | 2

| accepted

Answered
Free molecular diffusion following Fick's first law in 2D plane.
The pdepe function might be appropriate.

4 years ago | 0

| accepted

Load more