Answered
I get complex numbers when I manipulate an FFT spectrum
The easiest way to do this is with a bandstop or notch filter in the time domain. If you must do it in the frequency domain, ...

3 years ago | 0

Answered
FUNCTIONS IN GENETIC ALGORITHM
‘Can I apply the Genetic Algorithm to a fitness function that calls other functions?’ Yes. ‘and global variables are a p...

3 years ago | 0

| accepted

Answered
Is it possible to obtain the initial data after "smoothdata" function?
In general, no. Smoothing involves filtering of some sort, and that removes the higher-frequency details of the original sign...

3 years ago | 0

| accepted

Answered
Finding x-intercept in a 2d plot shown below, there are multiple loops I want to find all the values of X at Y=0...Please help..
Something like this should work — %Finding X value with known Y value on plot t = linspace(0, 2*pi, 1000); ...

3 years ago | 0

Answered
I want to delete part of a row in an array but it kept returning an error
This cannot be done with a numeric array, however it can be done with a cell array. The disadvantage is that it must be kept ...

3 years ago | 1

| accepted

Answered
How can I plot 2D surface plot with color bar
It is possible to create a surface plot from it, however it is probably not worth the effort — T1 = readtable('https://www.mat...

3 years ago | 0

| accepted

Answered
How to re-scale an axis
Try something like this — x = linspace(0, 2E6, 2E6); y = sin(2*pi*x/1E6); figure plot(x, y) figure plot(x, y) xt = g...

3 years ago | 0

| accepted

Answered
comparing between two cell arrays
I am not certain what result you want. Try this, and if it works, loop through the elements of ‘A’ and ‘B’ for all the necess...

3 years ago | 0

| accepted

Answered
How I can impliment my objective function inside this GA?
Since ‘objective function’ implies curve fitting, try something like this — x = 1:0.1:10; y = 2.5*exp(-(x-5).^2/2)+randn(size...

3 years ago | 0

| accepted

Answered
How to extract X value given Y value from graph.
%Finding X value with known Y value on plot clc; clear all; close all; x= 0:0.01:5; y= [0.2 0.4 0.7 0.9 1.0] [X, Y] = mesh...

3 years ago | 1

Answered
I need to make the vectors the same length
One option is interp1 — x = 1:9 y1 = randi(9, 1, 5) y1_new = interp1(linspace(min(x), max(x), numel(y1)), y1, linspace(mi...

3 years ago | 0

Answered
Simulate and plot Butterworth filter frequency response using transfer function
If you want to see the frequency response, use the bodeplot function — R = 10; L1 = 10; L2 = 10; C = 1; ...

3 years ago | 1

| accepted

Answered
how can you loaded time series data, dependent and independent data in excell file?
I usually use readtable for such problems. It has the advantage of importing everything as well as the column headers.

3 years ago | 0

Answered
Error with simultaneous differential equations
The problem is that ‘t’ is not a function (and shouldn’t be one), so ‘t(0)’ is interpreted as an array reference. Compounding t...

3 years ago | 0

| accepted

Answered
precision of function: UNIQUE
That they are not monotonically increasing is not the same as their not being unique. That is a different problem. If you kn...

3 years ago | 1

Answered
find the value of K for the first positive (real-number) value of R
One approach — G1=tf([3],[4 5 5 1]); figure rlocus(G1) [R,K]=rlocus(G1) Rfin = isfinite(real(R(1,:))); Kv = interp1(r...

3 years ago | 0

Answered
How to get the Z-Axis of power spectrogram?
To see it in 3D, use the view function and choose an appropriate azimuth and elevation. (It was a surf plot in earlier release...

3 years ago | 0

| accepted

Answered
Matlab R2022a: Are all prediction models available in Matlab?
Search the online documentation (and your own Help Center Browser) for predict. This links to the first one that shows up, an...

3 years ago | 2

Answered
Need help with contour plot
Because the length of ‘Z1’ is thelength of the product of the lengths of ‘X’ and ‘Y’ it may simply be necessary to reshape it to...

3 years ago | 1

| accepted

Answered
randomly sample a pair of values in a double
‘I need to RANDOM sample one of the coordinate pairs inside the coord_iso. how can I do?’ One option — RandomRow = randi(si...

3 years ago | 0

| accepted

Answered
How can i simulation this Question
The randn function will produce Gaussian distributed random numbers with a standard deviation of 1. Your assignment says: ‘un...

3 years ago | 0

Answered
Error using DynamicSystem/lsim
Instead of: % Define u(t) u = 1; use: % Define u(t) u = ones(size(t,2),1); Then, it works — % clc % Define the matric...

3 years ago | 0

| accepted

Answered
using trapz in a for loop
The problem: for i=1:length(n) This returns 1 since ‘n’ is a scalar. You probably intend: for i=1:n however that is sti...

3 years ago | 0

Answered
Scaling a graph in MATLAB
It would likely be more appropriate to use stackedplot (or subplot or tiledlayout) for this. Presenting each in separate axes w...

3 years ago | 0

| accepted

Answered
plot a real EEG data save as csv file
Use readtable and then select the appropriate variables rather than using table2array. Without knowing more about the cell arra...

3 years ago | 0

Answered
Generate Filters coeffitients using *.m file
If I understand your question correctly, the filter coefficients are the ‘h’ vector. Also, use filtfilt for the best results,...

3 years ago | 1

| accepted

Answered
I am doing gait analysis. I suppose the black labelled ones are the steps, what is the red labelled ones? The sensor is placed on the thigh, what might cause this?
We’d have to know more about the instrumentation. It’s likely that the red regions are heel-strike and associated thigh-muscl...

3 years ago | 0

Answered
Wrong plot upon right calculation
If it needs to begin at (0,1), the only changes required are that in the ‘K’ assignment, the current value of ‘f1’ needs to be r...

3 years ago | 0

| accepted

Answered
How can i use intersect function correctly ?
Use calls to interp1 in a loop to get each intersection — f=@(x)1+cos(x); g=@(x)sin(x); fg = @(x) f(x)-g(x); x=-8:.01:8; A...

3 years ago | 3

| accepted

Answered
I have a line of experimental data and need to plot confidence interval
I recognise my code (although it’s likely fairly old). This calculates the plots the confidence intervals for a matrix of exp...

3 years ago | 0

Load more