Answered
Finding Slope of a curve at a specific point
Try something like this — x = linspace(1, 10); y = sin(2*pi*x/3) + cos(2*pi*x/9); dydx = gradient(y) ./ gradient(x); xv...

4 years ago | 0

| accepted

Answered
Aligning two noisy signals
See if the alignsignals function will do what you want. EDIT — (18 Aug 2022 at 16:04) With the signals now provided, I can...

4 years ago | 0

| accepted

Answered
Measure time difference peaks and stores it
It would help to have the data. One approach would be to use the islocalmax function two times using the 'FlatSelection','fir...

4 years ago | 0

| accepted

Answered
highlighting a section of a plot
The ‘x’ vector needs to have more elements in order to provide the necessary resolution to draw the patch object correctly. T...

4 years ago | 0

Answered
Define secondary variables based on main variables in fsolve
The ‘NELF’ argument needs to be a vector. Also MATLAB is case-sensitive so I made all the vector references capital ‘X’ since t...

4 years ago | 0

| accepted

Answered
How to calculate FWHM from gaussian histogram fit?
Thje easiest way is to use histfit and then findpeaks with the name-value pair appropriate arguments — X = [0.6268 0.5372 ...

4 years ago | 0

| accepted

Answered
First element greater than
Try simething like this — v = randi(9, 1, 20) x = 7 first_x_idx = find(v > x,1,'first') Result = v(first_x_idx) .

4 years ago | 1

| accepted

Answered
Plotting multiple curves in same graph
See if the hold function will do what you want.

4 years ago | 0

Answered
T is not defined, dont know how to fix
I only see one call to the ‘lacO’ function and the code calling it runs correctly, after the ‘@’ sign is removed in front of the...

4 years ago | 0

Answered
Retreive standard deviation from noise
If you have some idea of the characteristics of the underlying signal (assuming that there is a signal with white noise added to...

4 years ago | 0

Answered
Calculating roots of an equation in Matlab.
When you delcared ‘a’ as symbolic, you cleared its numeric value. Try this — a = 2 kepa = 3/13 lambda = 9 b = -log(kepa)...

4 years ago | 2

Answered
Number of peaks in the interval
A simpler way (if you have the Signal Processing Toolbox) would be to use the buffer function to segment the vector. Then, simp...

4 years ago | 0

| accepted

Answered
Can I parse a text file with dates and data using readmatrix or readtable?
It would help to have the file to experiment with. I would just use readtable with no other name-value pairs, and see the res...

4 years ago | 0

| accepted

Answered
Trying to plot an estimate of a surface with plot3
Use the surf or mesh functions to plot a surface matrix. Try this — f = @(x,a) a(1)*x+a(2); x = [0.558755760368664;0.83525...

4 years ago | 1

| accepted

Answered
how to insert data into matlab
With R2015a use the xlsread function to import the data. Get all of the outputs in case there is column header information that...

4 years ago | 0

Answered
butterworth filter gain higher than zero
The problem is that the plots provided by either fvtool or freqz do not use the scaling factor (‘glow’ here). Plot them separ...

4 years ago | 0

| accepted

Answered
Contour Plot Wrong Colors
I get a slightly different result when I use ‘torquev’ and ‘rpmrangev’ to define the interpolation grids, so that may be the pro...

4 years ago | 0

Answered
the legend is not working properly
My guess is that you have an AMD graphics card, and have not updated the graphics drivers in a while. (This sort of legend prob...

4 years ago | 1

| accepted

Answered
How can I limit the load function?
I am not certain what you want, however one option is to Load List of Variables into Structure Array You can then limit the va...

4 years ago | 0

Answered
How to combine a marker to a line and show in legend?
Insteaqd of using separate line and scatter calls, use plot. Specifically, see LineSpec.

4 years ago | 0

| accepted

Answered
FFT from .csv voltage and current data file
These are not easy files to work with. That is likely the problem. Try this — C1 = readcell('https://www.mathworks.com/mat...

4 years ago | 1

| accepted

Answered
how to import csv file with along with its headers in the matlab?
You don’t say what Release you’re using, however in R2022a the readtable function seems to do exactly what you want — T1 = rea...

4 years ago | 0

| accepted

Answered
Fourier series fit to a periodic function with multiple frequencies
Adding a second function will change the baseline, for example — t = linspace(0, 10, 1000); s = sum((1./[1;3;5]).*sin([1;3;5]...

4 years ago | 0

Answered
Get the data points after smoothening the plot
I am not certain what you are asking. Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_f...

4 years ago | 0

| accepted

Answered
fft function error while extracting EEG signals in EDF file
According to the edfread documentation, the ‘data’ are the first output, not the second. The assignments should probably be: ...

4 years ago | 1

| accepted

Answered
How to determine an y value at a specific x value?
Since ‘sm1’ is a function of ‘W1’ this is not as straightforward as it might at first appear. v1=0.034; %viskozite yağ için...

4 years ago | 1

| accepted

Answered
Plot is not lined up with the X axis
I am not certain what the problem is. Using plot with only one argument plots the argument with respect to the indices of the a...

4 years ago | 0

| accepted

Answered
using GA including a hybrid function option
In the optimoptions call, the 'HybridFcn' name-value pair must have a function handle to they hybrid function as its value. I...

4 years ago | 0

| accepted

Answered
Plotting sine wave valley to valley
Perhaps something like this — t = linspace(0, 1, 250); freq = 5; s = sin(2*pi*t*freq + 3*pi/2); figure plot(t,s) grid ...

4 years ago | 0

| accepted

Answered
display comma in xlabel
In the NumericRuler Properties documentation see TickLabelFormat to understand how to put the comma thousands separator in the t...

4 years ago | 0

| accepted

Load more