Answered
Scatter multiple table rows above same X-axis value
Try this — M = [1859 25.7 25.4; 1860 25.7 23.6; 1861 24.9 26.3]; figure scatter(M(:,1), M(:,[2 3]), 'filled') grid xlim(...

4 years ago | 0

Answered
Patch error when I plot x,y,z
Make them different colours and specify a view angle and it works — LD = load(websave('hex_3d','https://www.mathworks.com/matl...

4 years ago | 0

| accepted

Answered
How can I find order (or size) of a defined matrix (2D Array)?
Try this A=[ 1 2 3; 4 5 6; 7 8 9]; szA = size(A) .

4 years ago | 0

| accepted

Answered
How to plot a matrix that varies with theta?
Use the hold function to plot them all on the same axes, and use a marker to plot individual points. (The plot function plots l...

4 years ago | 1

| accepted

Answered
curve fit gaussian CDF
Consider using normcdf with mle or fitnlm. Try this — y = [ 0.0010 0 0.0020 0.0060 0.0210 0.0400 ...

4 years ago | 1

| accepted

Answered
how get date fromthe long number?
D = 1246573330; DT1 = datetime(D, 'ConvertFrom','datenum') DT2 = datetime(D, 'ConvertFrom','excel') DT3 = datetime(D, 'Conv...

4 years ago | 2

| accepted

Answered
How to transpose many matrices X_1 ... X_N at once?
Try something like this — X1 = randi(9,3) X2 = randi(9,3) X3 = randi(9,3) Xcat = cat(3,X1,X2,X3); Ycat = permute(Xcat,[2...

4 years ago | 2

Answered
How to add apostrophe as a text in a char of date?
I am not certain what result you want. Try this — DATE = '2019-05-31'; A2 = ['TO_DATE(''',DATE,''', ''YYYY-MM-DD'') '] No...

4 years ago | 0

| accepted

Answered
Tilted (inclined) circle in 3D
I usually use the rotate function for these problems. It’s just esaier. Try this — r = 1; xm = 0; ym = 0; teta = linspace...

4 years ago | 0

| accepted

Answered
I want to plot a complex function f(z) in 3D
I’m not certain what you want. Try this — t = linspace(0, 10); f = @(z) conj(z)./z; z = exp(1j*2*pi*t/max(t)); figure ...

4 years ago | 0

| accepted

Answered
Why the figure of the phase discontinuous?
The phase is likely wrapped. Use the unwrap function to provide a continuous phase. It may be necessary to experiment with i...

4 years ago | 0

| accepted

Answered
How to assign legend and marker to a 2D graph in Matlab?
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1103385/sample.csv') % T1.Properties.VariableN...

4 years ago | 0

| accepted

Answered
Why is matlab showing the wrong answer?
The limits are reversed in the int call. syms x y t yint = t^2-(1/t)*y*(t/57) int(yint, t, 0, 57*x) .

4 years ago | 1

Answered
I want to convert one time format into another type
Another approach — dt1 = '16-Aug-0022 04:39:55 PM'; dt2 = datetime(dt1, 'InputFormat','dd-MMM-00yy hh:mm:ss a', 'Format','MM/...

4 years ago | 1

Answered
How do I modify my x data to be a specific length?
I am not certain what you want. Try this — x = [326,406,406,449,491,491,1353,1353,2379,2379]; y = [3.46,3.48,3.48,3.48,3.4...

4 years ago | 0

| accepted

Answered
Plotting a function with for loop
Subscript ‘G’ to save it as a vector — a=100.400; b=230.033; c1=1; c2=4; k=1:100; for i =1:1:100 G(i)=1+c1*exp(-j*i*...

4 years ago | 0

Answered
Doing Fourier transform (FFT) of the output of an ode45 solution and subsequent plotting in the frequency domain.
The fft function requires that the time domain signal be samoled at regular intervals. The numerical dddifferential equation in...

4 years ago | 2

| accepted

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

Load more