Answered
Error using fmincon (not enough input arguments)
The optimisation functions want a vector argument. Create: Sfcn = @(b) S(b(1),b(2)); to do that, and it works — LD = lo...

3 years ago | 0

| accepted

Answered
How to calculate the number of points in each rectangular grid cell
Perhaps the histcounts2 function could make this easier. EDIT — (8 Aug 2023 at 15:49) Added this example — x_hit = 0.5+r...

3 years ago | 0

| accepted

Answered
CSV readtable dosen't work
Perhaps something like this — T1 = cell2table(compose('%f',randn(5,7))) VN = T1.Properties.VariableNames; T2 = varfun(@str2d...

3 years ago | 1

| accepted

Answered
Effect of Increment of Variable on Output in a Multivariate Equation
Perhaps taking the partial derivative of with respect to (creating a sort of sensitivity function) will do what you want. Yo...

3 years ago | 1

| accepted

Answered
How to resample (or interpolate) trajectory from x original values to 100 values?
resample_rate = 100; % xypos_resampled = zeros(resample_rate, trialno*2); % make space for multiple trajectories trialtotest...

3 years ago | 1

| accepted

Answered
Parse variable in a table
Several options, depending on what you want — timestamp = '2023-02-24 13:00:00' DT = datetime(timestamp) Date = DT; Time = ...

3 years ago | 0

| accepted

Answered
File: untitled.m Line: 1 Column: 5
Eliminate the parentheses — C = 3e8; fc = 60e9; lambda = C/fc; N = 2; % number of antenna in Tx M = 2; %...

3 years ago | 1

| accepted

Answered
Second Z-axis's
Perhaps this — x = linspace(0, 40, 20).'; zv = linspace(2, 4.5, 4); z = repmat(zv,1,3).*exp(-0.1*x) + rand(numel(x),12)/2.5;...

3 years ago | 0

| accepted

Answered
How to export a set of tables to Excel
One option using writetable is to use the 'Sheet' name-value pair (the first entry in the documentation section on Spreadsheet F...

3 years ago | 0

Answered
'Polyfit' vs 'Detrend' function
It can be linear although polynomial trends are permitted. To visually understand how it works, see the documentation section o...

3 years ago | 1

| accepted

Answered
How to know which decomposition algorithm was applied (trenddecomp ())
As I read the trenddecomp documentation, ‘SSA’ appears to be the default. It would be necessary to specifically choose ‘STL’ wi...

3 years ago | 1

Answered
concatenation of solutions of ODE
I would create one ‘tspan1’ vector with a specific number of elemensts, and the same for ‘tspan2’ although they are only require...

3 years ago | 0

Answered
How to filter columns and count data
It would help to have the data. I would be tempted to do something like this: Mishaps = readtable('YourData.xlsx') TTCv = Mi...

3 years ago | 0

Answered
select a portion of the matrix
One approach — LD = load('matrix_C.mat'); C = LD.C idx = find(sum(C(:,[2 3 4])==0,2)==3, 1); Result = C(1:idx,:) .

3 years ago | 0

| accepted

Answered
passive RC highpass magnitude FRF to MATLAB FIR coefficients
I generally don’t design filters with such specificity, and so usually use relatively straightforward command-line functions. T...

3 years ago | 0

| accepted

Answered
How to convert idinput signal to analog signal
As I understand lsim, it automatically samples continuous time models using the defined method (or the method it decides to use,...

3 years ago | 0

| accepted

Answered
How to expand a symbolic matrix expression?
I am not certain what you intend by ‘expand’. One option could be: sympref('AbbreviateOutput',false); that I added, and an...

3 years ago | 0

| accepted

Answered
Staked 3D line chart
Perhaps something like this — x = linspace(-40, 0, 20).'; zv = linspace(2, 4.5, 4); z = repmat(zv,1,3).*exp(0.1*x) + rand(nu...

3 years ago | 0

| accepted

Answered
How to find the linear slope of a set of data points on a graph
Perhaps this — T=[0 0.250000000000000 1.14000000000000 2.33000000000000 3.58000000000000 4.76000000000000 5.150000000000...

3 years ago | 0

| accepted

Answered
insert one of bar graph "inside" the other
See for example Position Multiple Axes in Figure in the axes documentation for one way to do this. EDIT — (2 Aug 2023 at 17...

3 years ago | 0

| accepted

Answered
Overlay and group two (or more) bar graphs (value by value)
Try this — LD1 = load('CountArray_A.mat'); LD2 = load('CountArray_S.mat'); CountArray_A = LD1.CountArray_A; CountArray_S = ...

3 years ago | 0

| accepted

Answered
Bessel filter analog to digital
Simply stated, there is no reliable method of digitsing a Bessel filter, and even if you managed to get some sort of result usin...

3 years ago | 0

Answered
How can I indicate the period of time in trenddecomp() function when using a timetable input?
Looking at the documentation for trenddecomp, it seems that the period needs to be in the same units as the sampling interval. ...

3 years ago | 1

| accepted

Answered
Centering Colorbar and Reducing Label Padding
Changing the position can be a bit more efficient — hcb=colorbar('south'); hcb.Label.String='Colorbar Title'; colorbarpos=hc...

3 years ago | 0

| accepted

Answered
How to change the name of a table and its headings?
This should work in R2020b — Interval_of_speed_rpm = randn(5,1); Duration_of_speed_sec = randn(5,1); Time_duration_vehicle_s...

3 years ago | 0

Answered
How to remove a single point from meshgrid?
I would use ‘logical indexing’ to simply delete that point — x = linspace(-3,10) y = linspace(-3,0) x = x(x~=0) y = y(y~=...

3 years ago | 1

Answered
linear interpolation for the curves
There are missing data, however they are all at the end of the first -time-pressure values. Filling them would require extrapol...

3 years ago | 0

Answered
Spectrogram of EEG signal
One approach — Fs = 256; figure spectrogram(EEGsignal, hann, [], [], [], Fs) xlim([0 700]) ...

3 years ago | 0

Answered
How to filter signals properly?
The filter is not going to do much actual filtering. Try this — LD = load('sampleSignal.mat'); sampleSignal = LD.sampleSig...

3 years ago | 0

| accepted

Answered
How can we compute the given integral using the data rho(x, y, z)
Perhaps using the integral3 function.

3 years ago | 0

Load more