Answered
Plot matrix with ticks corresponding to the data points
Try something like this — LD = load(websave('M','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1321115/M.mat'...

16 days ago | 0

Answered
Y double axis plot
The problem is: y1 = [1 1.273; 0.636 0.751; 0.247 0.287; 0.267 0.32; 0.268 0.311; 0.33 0.407; 0.266 0.389; 0.768 1.22; 0.21 0....

17 days ago | 1

| accepted

Answered
Plot several seasonal NDVI time series data with marked transplanting time
I am not certain what you want to do with these data. I have no idea what ‘NDIV’ refers to. This creates patch objects beginn...

17 days ago | 0

Answered
Convert Logical Column to Table
Use the addvars function — T1 = array2table(rand(10,4), 'VariableNames',{'A','B','C','D'}) LogicalVector = rand(10,1)>0.5; ...

17 days ago | 2

| accepted

Answered
Signal Fitting with sine curve (and how to find out the phase shift?)
I initially wnated to see if I could get this to fit using fminsearch, however I wasn’t guessing the correct initial parameter e...

17 days ago | 1

| accepted

Answered
fplot tolerance parameter error
Please begin to use anonymous functions rather than inline funcitons — x = @(t,e) (1/e) .* ((t>0) & (t<=e)); e = 1/100; t1...

18 days ago | 1

| accepted

Answered
Why do I receive the error message "Array indices must be positive integers or logical values. Error in Master (line 32)"
I am guessinmg that it could be: lambda_sq=(pir.*wr_sq.*lr_sq + pin.*wn_sq.*ln_sq) - g(pin.*wn_sq.*ln_sq.*(taux+alpha./alpha.*...

18 days ago | 1

| accepted

Answered
Removal of background continuum emission from a LIBS spectra
It would help to have the data, and a description of the desired result, since I do not understand ‘background continuum emmissi...

18 days ago | 0

| accepted

Answered
Im getting a blank graph, and alot of errors.
Use an anonymous function instead of the deprecated inline function, and since the ‘x’ function actually returns a logical resul...

18 days ago | 1

| accepted

Answered
Matlab: How can I specify the RGB color and line style for each curve in a waterfall plot?
It is likely easier to do this using plot3 — figure xaxis = linspace(-pi/2,3/2*pi, 200); variation = [ 0.5 1 5 10 7 3.5 8 0....

18 days ago | 0

Answered
FFT analysis with window of vibration during milling
The signals have broadband noise, so any sort of frequency-selective filter will not adequately eliminate it. There are two way...

18 days ago | 1

Answered
plot specific frequency of signal
Are you certain that 500 Hz is the correct sampling frequency for this trace? That would calculate to a heart rate of 335 bpm...

20 days ago | 0

Answered
Plot 3D Surface with 4D Colour - Can not Create Surface, only Data Points
The surface function allows the apploication of a specific color matrix to a surface plot. (The surf function does not.) Tr...

20 days ago | 0

Answered
Logical Indexing With LinSpace Issues
format long X = linspace(0.2,3,29) %Creates an array going from 0.2 -> 3 via steps of 0.1. So 1.3 is in it. disp(X(12)) fl...

20 days ago | 2

| accepted

Answered
Shaded error area of Std Dev.
It would of course help to have your data. However this call: std_y = std(P_all,0,2); implies to me that your data are col...

20 days ago | 0

| accepted

Answered
z=f(x,y) and w=f(x,y). I am trying to reverse the table to get x=f(z,w) and y=f(z,w).
Apparently, X, Y, Z and W are all equal-sized matrices. Assuming that there is essentially a one-to-one correspondence between ...

20 days ago | 0

Answered
Plot data in matlab
Isn’t that just this — Scaled = @(data,Th) [data(:) ones(size(data(:)))] * ([Th 1; 0 1] \ [1; 0]); % Scale Data By Thresho...

21 days ago | 1

| accepted

Answered
I have a problem in the annexed excel file there are two tables, first table give the graph representing geological layers I need to get the second table with Matlab Code
One approach — C1 = readcell('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1315950/Salt%20Dome%20Interpretat...

21 days ago | 0

Answered
Hi , all there , i have an excel file that i want to split it by special element value in the file to some files . how can i make it possoble with matlab
To begin a new sub-array whenever a zero appears in any row, this works — M = randi([0 20], 15, 4) ZeroInRow = any(M==0,2); ...

22 days ago | 0

Answered
How to find troughs of a signal below a threshold
Use the 'MinPeakHeight' name-value pair — t = linspace(0, 2*pi, 500); s = sin(2*pi*t) - sin(2*pi*0.1*t-0.45); Threshold ...

22 days ago | 0

Answered
How do I fill colour on both sides of the sin wave in this graph?
Using the patch function — % Define the time axis (x-axis) t = linspace(0, 12, 1000); % Define the parameters of the sinusoi...

22 days ago | 0

Answered
code is right but can not the a plot
You need to redefine ‘t’ so that it matches the row size of ‘u’: t = linspace(0, 2.5, size(u,1)); Try this — % clear % cl...

23 days ago | 0

| accepted

Answered
Plot several time series data stacked in one graph
Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1314900/Data.xlsx') VN = T1.Propert...

23 days ago | 1

| accepted

Answered
Data normalization with threshold
I am not certain what you want to do. Perhaps one of these — data = [10,30,50,75]; threshold_value = [70]; Result = no...

23 days ago | 1

| accepted

Answered
How to save the scatter plot with and without transparency
The gca function (of course) is ‘get current axes’, and it does exactly that. One option is to save an axes reference in each s...

23 days ago | 0

| accepted

Answered
Undefined function 'geomean' for input arguments of type 'double' in Matlab 2020
An alternative is: gm = @(x) prod(x)^(1/numel(x)); x = rand(1,100); y1 = geomean(x) y2 = gm(x) .

24 days ago | 2

Answered
Extracting specific data from time range excel
It would help to have the Excel file. The ‘1 data raeading per hour’ request is open to intpretation. First, convert the t...

24 days ago | 1

| accepted

Answered
Normalize the amplitude of a sinewave of varying amplitude and frequency
‘I need to determine each "cycle" by detecting zero crossings and the peaks and valleys, then determining the peak and vally for...

25 days ago | 0

Answered
How can I remove a pulse from a soundwave?
If the pulse is at a single frequency with known bandwidth, just use a bandstop filter. If there is energy at several frequenci...

25 days ago | 2

Answered
Don't know how to fix error preallocating for speed
It’s likely not an error, simply a suggestion that preallocating for speed would be advisable. (A preallocated loop generally r...

25 days ago | 0

Load more