Answered
Calculate slope of a discrete points
I would use the gradient (link) function. Since the data need to be sampled regularly with respect to the independent variable ...

8 years ago | 0

| accepted

Answered
Plot cylinder symmetry axis
I am not certain what you intend by ‘axis’. If you just want a line through the axis of the cylinder, try this: [X,Y,Z] = c...

8 years ago | 0

| accepted

Answered
FFT on low sample count signal
Without seeing your signal, it is not possible to suggest a specif approach. One option may be doiing a nonlinear regression on...

8 years ago | 1

| accepted

Answered
Substituting an expression not giving intended result
Since ‘Phi’ does not appear as such specifically in ‘A’, the substitution will fail. Perhaps this is closer to what you want:...

8 years ago | 0

| accepted

Answered
inverse of mod function
As a general rule, no, you cannot uniquely determine whatever ‘a’ is. The mod function returns the remainder after division, so...

8 years ago | 0

| accepted

Answered
Chage commas with dots in sequential txt files?
Without an example file, it is not possible to write specific code. I would use the textscan (link) function to read them in ...

8 years ago | 0

Answered
legend at a desired location on a plot
Use the 'Position' (link) property of legend. It does not work exactly as you would like it to, however you apparently can pu...

8 years ago | 0

| accepted

Answered
Separate max and min for 1 or 2 meter intervals
If I understand correctly what you want to do, one possibility is to interpolate to regular distance increments: A = [1.23 ...

8 years ago | 0

| accepted

Answered
How to better process a dampened signal in order to find distinct peaks
One approach: D = load('pad_vs_time.mat'); time = D.time; pad = D.pad; N = numel(time); Ts = mean(diff(time)); Fs = 1/T...

8 years ago | 2

| accepted

Answered
Can we check points are in straight line
If they are vertical (as in your posted image), just check to see if all the x-values are the same: x1 = [0.5 0.5 0.5]; y1 = ...

8 years ago | 1

Answered
How do I plot six different matrices?
This should get you started: t = linspace(0, pi, 20); % Create Data x = 3*cos(t); ...

8 years ago | 1

Answered
how can I fill between two plot lines from a matrix?
You did not post your data, so we can only guess what ‘naturalised’ is, although we can correctly assume that you are plotting c...

8 years ago | 0

| accepted

Answered
How can I evaluate P(x) here
When I attempted to integrate it analytically with my additions (including ‘dP’ and ‘d2P’), the result was an empty sym for ‘SPv...

8 years ago | 0

| accepted

Answered
sum of sin fit in curve fitting
That depends on how it is defined in the context of what you are doing. As a general rule, the argument to the sin() function i...

8 years ago | 0

| accepted

Answered
How to store three peaks on different frequencies?
One option would be instead to use 'MinPeakProminence' (link). See the discussion on Prominence (link) for a description of it....

8 years ago | 0

| accepted

Answered
Plot matrices in area graph of unequal length (i.e. size of rows)
The only approach I can suggest is to interpolate one or both data sets to a common set of dates. This is best done using the r...

8 years ago | 0

| accepted

Answered
Too many Input arguments
There are several problems with your code. The error you posted was due to requirement that ODE arguments to the differential e...

8 years ago | 0

| accepted

Answered
How to create a grid for harmonics in plotted spectrum
I am not certain what you want. One possibility could be to use the findpeaks (link) function to locate the peaks and locatio...

8 years ago | 0

Answered
How to draw equipotential lines on surface plot?
If I understand correctly what you want to do, use the contour3 (link) function. The code would go something like this: X =...

8 years ago | 0

| accepted

Answered
convert from linear units to dBm and dB
This is relatively straightforward. To solve it analytically, take of both sides, then rearrange to get: x_dbm = 20*log10(y_...

8 years ago | 1

Answered
Replace certain cell arrays by other cell arrays
A simple loop seems to work: idxv = [0; 1; -1]; T = {'T1','T2','T3'}'; PS = {'P1','P2','P3'}'; DS = {'S1','S2','S3'}'; lab...

8 years ago | 0

| accepted

Answered
How I make the plot like this?
This should get you started: x = linspace(0, 10*pi); % Create Data y = sin(x*...

8 years ago | 2

| accepted

Answered
Sequence of a specific number in a matrix
Try this: M = [ 0 1 1 1 0 0 1 0 1 1 1 1 0 0 0 1 1 1 0 1 0 1...

8 years ago | 1

| accepted

Answered
How to index a char array in order to use in strcat
The num2str call inserts spaces between the numbers (in MATLAB, and I assume also in Octave): octave = [4,4,4,5; 3,2,2,2; 2,4,...

8 years ago | 1

| accepted

Answered
Least Squares fit of model function
Everyong had the fminsearch function, so use it to do nonlinear curve fitting: f = @(b,x) b(1).*cosh(b(2).*x) + b(3); x=[ ....

8 years ago | 1

| accepted

Answered
how to do curve fiting of polynom?
Try this: q_vec = [-0.0141600000000000 -0.0118000000000000 -0.0118000000000000 -0.0118000000000000 -0.0118000000000000 -0.0118...

8 years ago | 1

Answered
Change how cells are printed
Cell array indexing can be a bit confusing when you first encounter it. One possible approach: C = {{rand(1,10)}, {rand(8,2...

8 years ago | 0

Answered
Frequency FFT for Vibration Data
You may not need the code, however I needed to write it to reply. Try this: [D,S,R] = xlsread('Vibration Data.xlsx'); RD =...

8 years ago | 0

Answered
How I can plot 2D figure (x,y) and add 3rd axis (velocity) by variation the color through the path?
One possibility is to change the second plot call to scatter, since the scatter functions allow color-coded markers. Try this...

8 years ago | 2

| accepted

Answered
How to solve a system of two paired differential equations
‘Any idea about what I am missing out?’ We would have to see ‘myODE1’ and ‘myODE2’ to provide meaningful responses. With res...

8 years ago | 1

Load more