Answered
Pulsewidth command giving empty column vector
It would be nice to see the waveforms that give values and those that do not. I suspect the reason is that the ones that do n...

5 years ago | 0

| accepted

Answered
Operands to the logical and (&&) and or (||) operators must be convertible to logical scalar values. What is my mistake ?
If thie posted code is in a loop and ‘sales’ is a scalar at each iteration, that error would likely not be thrown. salesv = r...

5 years ago | 0

Answered
Please someone should help me debug my error. The approximate solution is supposed to converge to the exact solution. I think i have problem with the code.
There are several typographical errors, at lelast with respect to the code representing the symbolic equations in the image. ...

5 years ago | 0

| accepted

Answered
Finding coordinates in a plot
I hope this is not homework! x = linspace(-5000, 5000, 250); y = [7.5; 1.9; 0.9] .* exp(-(0.001*[1; 0.85; 0.6] * x).^2); [y...

5 years ago | 0

| accepted

Answered
Is there a way to add error bars and standard deviations to a line plot figure?
Calculate the standard deviations using the std function, then plot the erroir bars with the errorbar function. .

5 years ago | 1

| accepted

Answered
How do I take the numerical solution of a system of ODEs and use that as a parameter in another system of ODEs?
The description of what you want to do is a bit ambiguous. The ‘pendulum’ solution is a (Nx2) matrix for ‘y’ with an associat...

5 years ago | 0

| accepted

Answered
Too many input arguments while solving BVP using bvp4c
The problem with ‘bvp_RHS’ was actually not with it, but with the extra argument to bvpinit. Eliminating that then produced the...

5 years ago | 0

| accepted

Answered
How to integrate linear system of vectorial equations?
syms kappa n(s) r(s) s t(s) r0 t0 n0 Y Eqn = [diff(r) == t; diff(t) == -r + kappa*n; diff(n) == -kappa*t]; rtn = dsolve(...

5 years ago | 0

| accepted

Answered
How to plot the surface of multiple data sets ?
It would help to have the actual data. N = 20; X = (0:N-1); Y = [1:3].'+zeros(size(X)); porous_upper = rand(20,3)+[0:2]; ...

5 years ago | 1

| accepted

Answered
Plot connected vertical points with different marks
Try something like this — x=[ 1 2 3 4]; M = rand(3,4); Mx = max(M); Mn = min(M); figure plot(x, Mx, 'd') hold on pl...

5 years ago | 1

| accepted

Answered
how replace dirac to diracz when need ?
I am not certain what you want to do. Since the independent variable may never exactly be 10.5, I drew that separately (‘i’ i...

5 years ago | 0

Answered
How do you evaluate the resultant function on int in time?
If you only need to code it and plot it, one approach would be to use the Symbolic Math Toolbox int and fplot functions. .

5 years ago | 0

Answered
Why is my code not plotting anything?
It is necessary to save the script as a .m file first, and the MATLAB Editor should have popped up the Save As window when you p...

5 years ago | 0

Answered
highlight different data on the same graph
Try something like this: Tclean = table(datetime('2021-07-21 00:00:00')+minutes(0:10:1000).', 'VariableNames',{'Time'}); % C...

5 years ago | 1

Answered
Question regarding the smooth filter function when using the Savitzky-Golay method
From the documentation: ‘... a fixed window length that is determined heuristically’ This can be returned as the second o...

5 years ago | 1

Answered
How I can run two different functions at the same time ?
I am not certain what you want, however one approach is to write a third function that returns all the outputs of the other func...

5 years ago | 0

| accepted

Answered
How do I randomly extract 20 segments of data from a signal?
If I understand correctrly what you want to do, this could work: signal = randn(60001,4) random_indices = randperm(size(signa...

5 years ago | 0

| accepted

Answered
Plotting CFD data contour in matlab
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/714947/snapshot_vel-0001.txt', 'VariableNamin...

5 years ago | 0

| accepted

Answered
Zero out sensor drift
If you have R2018a or later, use the highpass function to eliminate both the d-c offset and any low-frequency baseline drift. I...

5 years ago | 0

Answered
Undefined function or variable 'windrose' when trying to create a windrose
Search the File Exchange for windrose. .

5 years ago | 0

Answered
fplot Warning: Function behaves unexpectedly on array inputs.
The ‘lift’ funciton is symbolic, so no function handle is necessary to plot it with fplot. (If you want to create a funciton ha...

5 years ago | 1

| accepted

Answered
How I introduce step wise feeds to my ODES?
The usual approach is to integrate the differential equation system from the first feed time to the second feed time, stop the i...

5 years ago | 0

Answered
Changing parameter in a function when called by bvp4c
If you want to pass ‘k’ as an extra parameter, see the documentation section on Passing Extra Parameters for relevant examples. ...

5 years ago | 1

| accepted

Answered
Apply a time window to my fft
My version of MATLAB cannot run images of code. Perhaps something like this would work: t = linspace(0, 100, 1000); s = si...

5 years ago | 0

| accepted

Answered
How to plot contour map of x,y values with z as dependent variable?
If ‘M’ is the matrix in the image: y = M(1,:) x = M(:,1) z = M(2:end, 2:end); So for example: M = [NaN 1 2 3 4 5; 10 rand...

5 years ago | 0

| accepted

Answered
ROOT MEAN SQUARED(RMS)
l ~= 1

5 years ago | 0

Answered
Reading in data from text file in a certain format
A similar problem presented itself in Reorganization of experimental data and that solution could be adapted to your problem. I...

5 years ago | 0

| accepted

Answered
Linear interpolation two array with target value in one array
Interpolate using interp1: A=[483, 427, 306, 195]; B=[0, 0.25, 0.5, 0.75]; target = 241; Result = interp1(A, B, 241) Graph...

5 years ago | 0

| accepted

Answered
Formulas of Rise time, settling time, and other step-response characteristics for arbitrary-order transfer function
If you are estimating the transfer function from data, use the System Identification Toolbox functions, specifically iddata and ...

5 years ago | 0

| accepted

Answered
CSV huge data and mesh grid.
I am not certain what result you want. I would do somemthing like this: T1 = readtable('https://www.mathworks.com/matlabcen...

5 years ago | 1

| accepted

Load more