Answered
count cycles in a signal
Use the findpeaks (link) function. Since this appears to be a modulated sine carrier, you might also find the envelope (link) f...

7 years ago | 0

| accepted

Answered
Fresnel functions, with vectors?
You only need to make one ‘hard’ modification to vectorise your function, that being the last line. Otherwise, use the vectoriz...

7 years ago | 0

| accepted

Answered
Intersection of two surfaces
More detail (such as the data or surfaces themselves) would be helpful. The approach I would use is to subtract one surface f...

7 years ago | 1

| accepted

Answered
How to integrate for a data set ?
I have no idea what you are doing. Try this: filename = 'solar_spectrum.xlsx'; [D,S,R] = xlsread(filename); Phw = D(:,1);...

7 years ago | 0

Answered
duffing equation ODE45
Use: tspan = linspace(0, 100, 50); to create a ‘tspan’ vector with 50 elements between 0 and 100.

7 years ago | 0

| accepted

Answered
Plane Fitting a 3D Scatter Plot
A simple linear regression is straightforward: x = [14.9 1.7 0.0 10.9 0.0]; y = [11.3 9.1 23.7 12.8 2.9]; z = [5.32787E-17 2...

7 years ago | 1

| accepted

Answered
ECG R wave amplitude calculation
Probably the easiest way is to use the findpeaks (link) function.

7 years ago | 1

Answered
2nd order ODE system
If you have the Control System Toolbox, this problem is much easier. I’m keeping some of your initial symbolic code, however ...

7 years ago | 0

| accepted

Answered
How to use findpeaks in the frequency domain?
I would do something like this: [audio_file, Fs] = audioread("honours_gun.wav"); L = size(audio_file,1); Ts = 1/Fs; ...

7 years ago | 1

| accepted

Answered
How to select all z values for certain x y values?
I would do something like this: x = randi([10 19], 250, 1); % Create Data y = randi([20 29], ...

7 years ago | 0

Answered
splitting the date in the same line to three variables
Try this: start_date=20110101; dva = datevec(num2str(start_date,'%8d'), 'yyyymmdd') start_year = dva(1) start_month = dva(2...

7 years ago | 0

Answered
How to add right ylabel with complex values (attached data and code)
Try this: x1 = sort(rand(1,10)); % Create Data y1 = rand(1,10); ...

7 years ago | 0

Answered
how to solve this equation?
Are you absolutely certain you want to do this? This code: syms m x Eqn = x == ((10/11)^5.5)*((1+0.1*m^2)^5.5)/m; [sm,pa...

7 years ago | 1

Answered
output problem.The output coming is "s" .But I expected a numeric value.Can anyone explain me where the mistake is in this code?
I cannot run your code. I have no idea what ‘s’ is, however if it a symbolic numerical value, and if it does not contain any ...

7 years ago | 0

Answered
Time interval between samples
It would help to know what your data are. Lacking that, and finding the Wikipedia article on LIGO (link), you may have spikes i...

7 years ago | 0

| accepted

Answered
integration, area under the curve
See the Wikipedia article on Solid of revolution (link) for inspiration.

7 years ago | 0

| accepted

Answered
95 % confidence intervals symmetry
‘I am wondering if this symmetry is the natural property or it depends on the algrithom used to compute intervals.’ It is bas...

7 years ago | 0

Answered
How to plot latitude and longitude data vs time
I would use a 3D plot: time = 5 : 22; % Hours Lat = randi([130, 140], size(time)); ...

7 years ago | 0

Answered
How to find the coordinates of the point of intersection of a line and a curve?
Add these lines to the end of the previous code (How to draw a tangent using a point and an angle?): x2_near_origin_idx = find...

7 years ago | 0

| accepted

Answered
Undefined function or variable "new_m"
In the ‘co.m’ code, you commented out the preallocation of ‘new_m’: . . . %create a new matrix by eliminating the row an...

7 years ago | 0

Answered
limits in array size for filtfilt?
Use the isnan function to check to be certain that none of the data are NaN: NaNsum = nnz(isnan(your_signal)) The first NaN...

7 years ago | 0

| accepted

Answered
IFFT time-interval units
My calculations would indicate 0.25 ns. Derivation: Fn = 2E+9; % Nyquist Frequency...

7 years ago | 2

Answered
ode 45 not enough input arguments
Create a function handle (using the ‘@’ operator) for ‘F’: [t,u]=ode45(@F,[0,20],[0,1]); Your code works with that change. (...

7 years ago | 0

Answered
How to split 360*160*50 data into several 5*5*5 chunks?
Use the reshape (link) function: M = rand(360, 160, 50); R = reshape(M, 5, 5, 5, []); Rsize = size(R) ...

7 years ago | 0

| accepted

Answered
Highlight specific area of graph.
You have to change the code slightly to do this: x = linspace(-5, 5, 1000); y1 = -x; y2 = x.^2-4; lidx = y1 >= y2; figur...

7 years ago | 2

| accepted

Answered
Why can I not use findpeaks with this audio signal?
The findpeaks function takes a vector input for the first argument. Note that ‘audio_file’ is a (8447 x 2) (stereophonic) matri...

7 years ago | 2

| accepted

Answered
Increase a variable by 0.1 each iteration
You appear to be increasing ‘Dd’ in each iteration. It is increasing by adding whatever value of ‘i’ exists in each iteration t...

7 years ago | 0

| accepted

Answered
changing the size of data being written to xls
Have you considered other options such as dlmwrite (link) or writetable (link)? They might be more suitable.

7 years ago | 0

Answered
How do I combine thousands of excel files in MATLAB?
‘I haven't found anything that works for me so far.’ We don’t know what you’ve searched for, since you didn’t go into any detai...

7 years ago | 0

Answered
hi . i have solve ode system and plot T vs. time ,I want to write code to find value of time where the value of T become 309.5, so how can i writing this code ?
Try this: % % the script range=[0:0.0001:40]; ICs=[300,2,4,0.25,0]; [tsol,varsol]=ode45(@ode_sys,range,ICs); idx = find(va...

7 years ago | 1

| accepted

Load more