Risposto
How to restart optimization with ga ?
You can save the fittest individuals in each generation during the optimisation, then use the last (or all) of them to re-start ...

oltre 3 anni fa | 0

Risposto
Breaking the axis of plots (without external packages etc)
I am not certain what you want, so I decided to give this a shot just out of interest — x = [linspace(0, 10, 11); linspace(20,...

oltre 3 anni fa | 1

Risposto
How i can add the color below the figure?
If you are referring to the legend in the figure, it would be easiest to use the 'DisplayName' in every surf call so that the de...

oltre 3 anni fa | 0

Risposto
There is an error in call the function file
You need to call ‘fluxfunction’ from a script with specific values for ‘a’ and ‘b’ that already existing in the script workspace...

oltre 3 anni fa | 0

Risposto
take a value y of a function y = f(x) giving x.
Use an appropriate interpolation function, such as interp1 or just index into it, depending on what you want to do — x = 0:pi/...

oltre 3 anni fa | 0

Risposto
How to flip an ordered X-axis that is half half separated for data?
One approach that changes the x-axis and the data — xv = [1 2 3 4 5 6 7 8 9 10 11 12]; % Independent Vari...

oltre 3 anni fa | 0

Risposto
Power spectral density plot converted to sound pressure level
To generate an SPL plot, and assuming compatible units (among other things) — nfft=2048; window = hann(nfft); overlap...

oltre 3 anni fa | 0

Risposto
How to extract data from txt file and plot spectogram?
I prefer the pspectrum function for these analyses. See specifically Spectrogram and Reassigned Spectrogram of Chirp for an exa...

oltre 3 anni fa | 0

| accettato

Risposto
time interpolation of a 3d matrix containing wind speed data
The retime or synchronize would likely be more apporpriate here, however the resample function could work (and interp1 is an o...

oltre 3 anni fa | 2

Risposto
How to make a surface in polar coordinates using polar3d?
This takes too long to run here (it took 336.315050 seconds — 00:05:36.315049 — just now on MATLAB Online) however it plots the ...

oltre 3 anni fa | 0

| accettato

Risposto
how to consider only the integer part discarding the exponent part
This appears to be a reasonably robust approach — a = [1 23 56]*10^(-9); b = a.*10.^ceil(-log10(abs(a))+1) max_a = max(b) ...

oltre 3 anni fa | 0

Risposto
digital lowpass filter using Kaiser and Hamming window
Yes, I could. If you want to design one as well, use the fir1 functon. I also recommend the See Also section of the document...

oltre 3 anni fa | 0

Risposto
lsqcurvefit() moved from Matlab to toolbox?
The lsqucurvefit function has always been in the Optimization Toolbox for as long as I’ve been using MATLAB. You may be referri...

oltre 3 anni fa | 0

Risposto
FFT from a excel file
EDIT — (1 Jun 2023 at 16:07) The array is table apparently created by readtable. Use cell array indexing (explained below) or ...

oltre 3 anni fa | 0

Risposto
Appy lsqcurvefit to multiple data sets with multiple parameters
If I understand the problem correctly, and all the data sets contain column vectors and are the same column size (they do not ha...

oltre 3 anni fa | 0

Risposto
Why does str2double command return NaN? What type of array should I convert into for running fitlm command??
Of course str2double returned NaN for all of them because none of them are strings or character vectors. I suspect there are ...

oltre 3 anni fa | 0

| accettato

Risposto
Why the nonlinear least square fitted curve is not a curve?
Just for fun, I added a periodic function and a slope to the model — Data=[0.928571429, 0; 0.012118074, 1.5; -0.45000118...

oltre 3 anni fa | 0

| accettato

Risposto
GLOBAL VARIABLE :HOW USE IT?
Please do not ever use global variables. Use the approach described in Passing Extra Parameters instead.

oltre 3 anni fa | 2

Risposto
how to find average curve of n curves? n=3 in this case
This is a bit more involved than it first appears. Getting the data from the .fig file is straightforward, however it then ge...

oltre 3 anni fa | 0

| accettato

Risposto
How to let Matlab divide my data on time interval [0 400] into multiple time intervals in one plot [0 30] [30 60] etc.
If you have the Signal Processing Toolbox, use the buffer function and a loop — Fs = 259/50; Tlen = 380; t = linspace(0, Tle...

oltre 3 anni fa | 0

| accettato

Risposto
Error using extractAfter Numeric value exceeds the number of characters in element 1. What is wrong? How do I fix this?
You are making this much too difficult! If you want to remove specific variables, first use readmatrix (introduced in R2013b)...

oltre 3 anni fa | 1

Risposto
Hi everyone...I am getting transient peak in the signal from 0 to 6000 hz in the sound pressure level plot. Can anyone suggest me how to remove it?
If you are referring to the series of ‘spikes’, the easiest way would be to use findpeaks to define the spikes and the frequenci...

oltre 3 anni fa | 0

Risposto
What is diff. b/w fft and pspectrum command in Matlab?
If you only want to plot the magnitude spectrum, use the fft function. The differences between the various functions are sign...

oltre 3 anni fa | 1

Risposto
Process .dat file, plot, scale, and put back into similar format
It would help to have the file rather than an image. I would do something like this: fidi = fopen('Hled.dat','rt'); C = te...

oltre 3 anni fa | 0

| accettato

Risposto
How to shade the area between two lines (constructed by large number of data points)
It works the same way with data points as with functions — x = linspace(0, 10, 50).'; % Assume Column Vec...

oltre 3 anni fa | 0

| accettato

Risposto
three order complex coefficient polynomial root matlab
There are at least two options — z = complex(randn(3,1), randn(3,1)) r = roots([28; z]) syms x p = 28*x.^3 + z(1,:)*x.^2...

oltre 3 anni fa | 1

Risposto
lowpass filter function doesn't filter out data
The ‘NoisySignal’ has broadband noise, so a frequency-selective filter can eliminate some of the noise, however not all of it. ...

oltre 3 anni fa | 1

| accettato

Risposto
Plotting arrays with different sizes
Transpose ‘gamma’ to create a family of curves — gamma = [1, 1.2, 1.4, 1.6, 1.8, 2]; x = [0:0.01:2000]; b = 349.22567; y = ...

oltre 3 anni fa | 0

| accettato

Risposto
fitline not displaying correct x values datetime
You probably need to do centreing and scaling with your data, then use datetick to display the dates correctrly — dates = date...

oltre 3 anni fa | 0

| accettato

Risposto
MatLab Multiple graphs in one axis
The easiest option is to use the hold function. Put the different ‘x’ and ‘y’ vectors in one matrix, then plot them x = (9:0.2...

oltre 3 anni fa | 0

Carica altro