Answered
Distance between peaks for many data
See Process a Sequence of Files for an appropriate approach.

5 years ago | 0

Answered
Playing time-locked square wave using sound() function
Try this: Fs = 1E4; t = linspace(0, 0.7, 0.7*Fs); s = ((1+sign(sin(2*pi*t*1E3)))/2).'*[1 1]; % Create Binau...

5 years ago | 0

| accepted

Answered
Getting error while plotting best fitness, so how do I solve this issue or is there any alternative way to plot it (I am using Genetic Algorithm from Optimization Toolbox)?
That plots the output of your fitness function, and I find it interesting that complex results even work in that context. I h...

5 years ago | 0

Answered
surf function plotting temperature
The surf function requires either one or three arguments, if three the first two are either vectors or matrices of the independe...

5 years ago | 0

Answered
Generate all possible patterns from an existent table
I am not certain what you want as a result. One possibility: T = [ 2 5 10 17 33 1 10 19 20 ...

5 years ago | 1

| accepted

Answered
Frequency domain and windowing
It depends on the information you have. If you have the complex Fourier transform or the amplitude and phase information, it wo...

5 years ago | 0

Answered
How to fix error: "Index in position 1 is invalid. Array indices must be positive integers or logical values" caused by bad kernel
I am not certain what you are doing. One option may be the imfilter function. Another option would be to set ‘hard’ limits ...

5 years ago | 0

Answered
how to call the function and where i should call command window?? or within the niew script(in my code)
If you want to use the results in your script, call it from the script. The results will appear in your workspace. Note that...

5 years ago | 0

| accepted

Answered
Problem with fill / patch
It would help to have your data. Try something like this: x = linspace(0, 15000, 1000); y1 = (500*rand(size(x))-1E-5*(7000...

5 years ago | 0

| accepted

Answered
FSOLVE requires all values returned by functions to be of data type double.
Call the function with one parameter vector: fcn = @(b) F(b(1),b(2),b(3)); and with that change, this works: L0 = 3; ...

5 years ago | 0

| accepted

Answered
How can i define with variable
I still do not understand what you want to do, however it is straightforward to create ‘K’ as an anonymous function: K = @(a) ...

5 years ago | 0

| accepted

Answered
How to vary a variable in a system of ODE's?
Try this slightly changed version of your code: function dpdt = Tester(t,p,tau) dpdt = zeros(2,1); delta = 0.02; beta = 0.0...

5 years ago | 2

| accepted

Answered
Problem using ODE45 - current not recognized
I cannot run the posted code: Unrecognized function or variable 'alpham'. The others also appear to be missing. That aside...

5 years ago | 1

Answered
Latex text in Y-Axis
It does not throw any errors, it just does not do what you want it to do. Try this instead: xlabelname = {'Number of Sample...

5 years ago | 0

| accepted

Answered
Extract points which are inside a polygon
The inpolygon function comes quickly to mind.

5 years ago | 0

| accepted

Answered
Create floating bars, grouping each set of bars by a single month
Esperiment with this: T1 = readtable('dummy_model_data.txt', 'HeaderLines',1); T1.Properties.VariableNames = {'Model','Min','...

5 years ago | 1

| accepted

Answered
if/elseif for ranges of t
I would do something like this: v2fcn = @(t) 0.000182*(t < 7.5) + 0.00124*((t >= 7.5) & (t < 14.5)) + 0.000737*((t >= 14.5) & ...

5 years ago | 0

| accepted

Answered
How can I plot this function that contains integrals?
The problem would appear to be: M = (exp(-int(alpha-beta,x,x,W))./(1-int(alpha.*exp(-int(alpha-beta, x, x, W)),x,0,W ...

5 years ago | 0

Answered
Find NaNs at the end of an Excel file
See if the contains function (introduced in R2016b) will do what you want.

5 years ago | 0

| accepted

Answered
How to use abs between ln?
Try this: w = log(abs(real(c).^2.5 - 1202)); .

5 years ago | 2

| accepted

Answered
Putting two FAS figures into one.
Use the hold function to put multiple plot calls in the same axes. Example — figure plot(x1, y1) hold on plot(x2, y2) p...

5 years ago | 0

Answered
How to zero the region of the FFT output?
If you want to set the 0 frequency d-c (constant offset) component of the fft result to 0, subtract the mean of the signal from ...

5 years ago | 0

Answered
How to extract some information from a txt file
Try this: fidi = fopen('net3 report.txt'); for k = 1:26 getline = fgetl(fidi); end k1 = 1; while ~feof(fidi) N...

5 years ago | 0

| accepted

Answered
End to end plots
Try this: F = complex(rand,rand); % Use Actual Complex Value S = complex(rand,rand); ...

5 years ago | 0

Answered
Plotting the data in the given file over time period and tabulating the results
I have no idea what you want the result to be. Try this: D1 = load('data.mat'); StateFrequency = D1.StateFrequency; Col...

5 years ago | 0

| accepted

Answered
How to plot cubic equations ?
Here is one approach: f = @(x,y) x.*y.*(x.^2+y.^2) - 47.3; figure fih = fimplicit(f, [-10 10 -10 10]); xv = fih.XData; ...

5 years ago | 1

| accepted

Answered
Fit with an integral involved
Try this: function y = integralfit(b,Tv,R,nu,T0) % % % MAPPING: b(1) = E1, b(2) = E2, b(3) = Tstar, b(4) = Tdot f...

5 years ago | 0

| accepted

Answered
standard deviation in errorbar
Not silly at all, however it may not produce the result you want. It might be more appropriate to calculate the errors as the...

5 years ago | 1

| accepted

Answered
How to change the datapoints(extracted from a curve) into an array?
If you plotted the curve, you should already have all the data necessary to do the plot. What exactly did you plot, and how...

5 years ago | 0

Load more