Answered
MATLAB Equivalent of Linregress in Python?
If you have the Statisitcs and Machine Learning Toolbox, there are several options, among which are regress and fitlm. There ma...

6 years ago | 0

Answered
Interpolate, fit, and space data
I have no idea exactly what you want to do, or what your data actually are. For the ‘x’ data, I would probably use the linspa...

6 years ago | 0

Answered
Shading an area between two intervals on a plot
It is likely not possible to use area for this, since that is not how it was designed to be used. It is possible to use patch...

6 years ago | 0

| accepted

Answered
a problem with power spectrum calculation (FFT)
The mean of ‘data’ is -16657.4418730469. This is the D-C component, so it appears at 0 Hz, and completely prevents the details ...

6 years ago | 0

| accepted

Answered
Comapring Values in one Matrix to another
Another approach: A = [373 383 393 403 413 420 451 485 499]; B = [373 453 457 461 464]; C = ones(numel(B),1)*A; ...

6 years ago | 0

Answered
How to mark the maximum points in mesh
Add this loop just before the mesh call: for k = 1:size(Response_amp,1) [Ramax(k),Idx(k)] = max(Response_amp(k,:)); ...

6 years ago | 0

Answered
I need to find the angle from horizontal that tangents to a curve make for multiple points
I am not certain what you want to do, or the result you want. The easiest way to calculate numerical derivatives is to use th...

6 years ago | 2

| accepted

Answered
Reading Files and plotting in matlab
I am not certain what the responses to the input calls should be, so I did not run your code, only looked at it. It appears ...

6 years ago | 0

| accepted

Answered
Variables under the same name in different .mat files
Use load to load each of the files into a different structure. See Load List of Variables into Structure Array. You can then...

6 years ago | 0

Answered
Looking for documentation explaining M.' and other symbols to select data from an array
‘M. means the same as M(:,:)‘ No, not ‘M.’. The extra dot will throw an error. I am not certain what you are asking. S...

6 years ago | 0

Answered
Creating a vector of datetimes with increments of 15 minutes
Try this: Timestamp = (datetime('2020-06-30 23:45:00') : -minutes(15) : datetime('2015-01-01 00:00:00')).'; Timestamp.Format ...

6 years ago | 1

| accepted

Answered
simple question of creating a time vector
Without the exact details of your file (that I suspect is not exactly 60 seconds long), something like this will work: t = lin...

6 years ago | 0

| accepted

Answered
different sound file times
If you want all of the sound files to have the same sampling frequency, use the Signal Processing Toolbox resample function. On...

6 years ago | 0

Answered
There is something wrong in R.
The problem is in the way you call the exp function. This works: R = ((2.*h).*(f.^3))./((c.^2).*(exp(h.*f/(k.*T))-1)); .

6 years ago | 1

| accepted

Answered
Plot AREA limit in matlab
If you want the area between ‘abb_per’ and 100 filled, use the patch function. Try this: figure patch([n fliplr(n)],[abb_p...

6 years ago | 0

| accepted

Answered
lowpass() not working
A low passband with a very high sampling frequency is asking a lot of any filter. I am somewhat surprised that lowpass used a F...

6 years ago | 1

Answered
How to plot 3D surface with vector-input function?
The function you coded: FUN = @(x) = x(1).^2+x(2).^2; will only take the first 2 elements of ‘x’ (whatever it is), and will r...

6 years ago | 0

| accepted

Answered
extract mth and m+1st largest element from a vector
‘Is using sort is the best way?’ Yes.

6 years ago | 0

| accepted

Answered
How to write a multi line string?
Since ‘tran_models’ is an array, just use a loop: for k = 1:size(tran_models,1) fprintf(File,'%s\n', tran_models(k,:)); ...

6 years ago | 0

| accepted

Answered
How can I plot and reach to this figure ?
birthday = datenum(year, month, day); t = 0:ceil(datenum(now)-birthday); Physical = sin(2*pi*t/23); The rest would be calcula...

6 years ago | 0

Answered
Solving the Kinetic equations by Matlab coding
Try this: % % % k(1) = R_Inf, k(2) = k R1fcn = @(k,t) k(1).*(1-exp(-k(2).*t)); R2fcn = @(k,t) k(1).*(1 - (1-exp(-k(2).*t))...

6 years ago | 0

Answered
Changing scientific notation to long format
Select an appropriate option (such as long g) with the format function.

6 years ago | 0

| accepted

Answered
Plot fft and peaks on same plot
You did not provide ‘x’ or any of the parameters (such as ‘Fs’) so it is not possible to run your code, and you could easily hav...

6 years ago | 0

| accepted

Answered
How to repeat the same graph?
Try this: t = 0:40; y = exp(-0.385*t) + 10; y6 = repmat(y, 1, 6); t6 = 0:numel(y6)-1; figure plot(t6, y6) grid produc...

6 years ago | 1

| accepted

Answered
How to do segmentation on ECG signal for feature extraction
Use the Signal Processing Toolbox buffer function. Calculating ‘n’ is straightforward: n = 10 * 250 producing: n = ...

6 years ago | 1

| accepted

Answered
Toolbox of Genetic Programming
Download and install the Global Optimization Toolbox. Simple genetic algorithm code is relatively easy to write. It does not...

6 years ago | 0

Answered
how to plot 2 curve with together
First, use element-wise multiplication and division: m=0:0.01:50; f= ((7*m - 7*(m.^2 - (226*m)/7 + 15009/49).^(1/2) + 127)...

6 years ago | 1

Answered
If statement for input value
I would just use a loop: n = input('how many ingredients do you have'); %%FOOD INPUT for k = 1:n a(k) = input(sprintf('...

6 years ago | 1

| accepted

Answered
Find and plot peaks within range of FFT
The easiest approach would be to use the Signal Processing Toolbox findpeaks function. It has a number of name-value pair argum...

6 years ago | 0

Answered
Combining two stacked plots
I have no idea what ‘XArray’ and ‘YArray’ are, or how they may be related. Apparently, they have different numbers of elements,...

6 years ago | 1

| accepted

Load more