Answered
PLOTTING BAR GRAPHS with different colors
Try this — A = rand(1,400); x = 1:400; figure hb = bar(x, A); hb.FaceColor = 'flat'; hb.CData(1:10,:) = [ones(10,1) z...

5 years ago | 0

| accepted

Answered
How to create a diagonal matrix that starts at (1,1)?
Without using repmat — n = 4; lambda = 0.2; A = diag([0 ones(1,n)]*lambda) ,

5 years ago | 0

| accepted

Answered
first two inputs must have the same number of elements error(hw deadline soon)
Check the code to be certain that the first two input arguments are the same length. If they are not, change the code so that...

5 years ago | 0

Answered
Indexing a vector in a particular fashion
Index it pretty much exactly as ot was written — v = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; idx = [9, 10, 7, 8, 5, 6, 3, 4, 1, 2]; ...

5 years ago | 0

Answered
can't fing notching filter
First, the bandstop function is likely an effective substitute. Second, both FIR and IIR notch filters are straightforward to...

5 years ago | 0

Answered
How to split an array of tot seconds in windows of 60 sec haveing also windows without values?
I am not certain what the desired result is, however if I guess correctly the buffer function may be the solution. .

5 years ago | 0

Answered
I want to plot two spheres. It appear as ellipses. Can anyone help me?
Adding axis('equal') solves it! a=1; L=0.1; dd=5; c =-a/L; b =a/L; m =a*60; % [x,y]=meshgrid((c+...

5 years ago | 0

| accepted

Answered
Too Many Input Arguments
This works (with and without the norm call) — v = [0.1, 0.1, 0.1, 0.1, 0.1]; [B,fv] = fminsearch(@kinetics123, v) ...

5 years ago | 1

| accepted

Answered
loop for species names
Try this — Species = @(n) strrep(compose('C%dH%d', [n(:) 2*n(:)+2]), '1H','H'); Hydrocarbon = Species(1:5) Back to my ...

5 years ago | 1

| accepted

Answered
How to calculate the subtended angle ?
See my Answer to How can I calculate the angles between a polygons vertices? for an approach that appears to work. .

5 years ago | 0

| accepted

Answered
x,y,z values in 3d plot
Perhaps this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/807724/URM_shear_EPX1.xlsx', '...

5 years ago | 0

| accepted

Answered
3D plot from excel
Thanks for quoting my code! The second column ‘Y Coordinate (mm)’ is identically zero. The griddata function will of course ...

5 years ago | 1

| accepted

Answered
Stopping the automation of a 10 x 1 into a 10x10 matrix in Matlab.
Use element-wise dividion (./) iunstead of (/) in the acos call — theta = acos(n./d) EDIT — See Array vs. Matrix Operations...

5 years ago | 0

| accepted

Answered
Need to find cutoff frequency using frequency spectrum
I essentially already did all of that in my Answer to I want to remove 50 Hz noise using fir notch filter in ECG .

5 years ago | 0

Answered
I want to remove 50Hz noise using fir notch filter in ECG signal
That is straightforward — Fs = 1000; % Use Correct Sampling Frequ...

5 years ago | 0

Answered
Using Findpeaks to plot on a scatter plot and return the peak coordinates
I have not run the code, however I believe the scatter call used to plot the peaks has the arguments reversed. Try this inste...

5 years ago | 0

| accepted

Answered
Learning how to use functions
One problem is that there needs to be a multiplication operator between ‘30’ and ‘exp(6)’. The other problem is that the data...

5 years ago | 0

| accepted

Answered
code of z transform for kroneckerDelta
It works correctly in R2021b — syms n x(n)=kroneckerDelta(n-1,0) d=ztrans(x(n)) Perhaps an upgrade is in order? .

5 years ago | 0

Answered
How do you use ode45( ) when the equation is not in dy/dt form?
Since the equation as written involves the second derivative, it is also necessary to define the first derivative as a separate ...

5 years ago | 0

Answered
How can I remove lines connecting markers?
I am not certain what the problem actually is. One option is instead of plotting lines (the default for the plot function), s...

5 years ago | 0

| accepted

Answered
Index in position 1 exceeds array bounds (must not exceed 1)?
There must be something interfering with the function, since the code runs correctly here — Y=[1 -3 5 -9; 2 -1 -3 19;3 1 4 -...

5 years ago | 0

| accepted

Answered
how to separate an audio file based on different speakers
This is called Signal separation, blind source separation, and other terms. There are several ways to do it, one being independ...

5 years ago | 0

Answered
How to calculate energy of the signal at a specific frequency after applying FFT
The energy is the amplitude (so with the fft function, since it produces peaks of half amplitude in the negative and positive fr...

5 years ago | 0

| accepted

Answered
How to get rid of certain xticklabels?
‘Namely, I would like to have xticklabels as [1, 2, 4, 8, 16, 28, 32].’ It does exactly that when I plot it using the online ...

5 years ago | 0

Answered
Trying to find FIR filter coefficients
The ‘b’ vector are the coefficients, however specifying a sampling frequency of the signal the filter is designed to work with w...

5 years ago | 0

Answered
Help needed plotting very simple equation
It looks like that because only part of the function is visible in that plot. A ‘zoomed in’ part of the plot reveals it to be...

5 years ago | 1

| accepted

Answered
Creation of a legend of a graph with a for loop
The problem description is a bit difficult to interpret, however there are at least two possible solutions (if I interpret it co...

5 years ago | 0

| accepted

Answered
How to fix symbolic errors
The problem is in ‘line 31’ and I suspect the reason is that ‘B_xy’ is initialised as a double array. I have no idea what the...

5 years ago | 0

Answered
I have a problem with interpolation.
I have no idea what the data are or the code is doing. The scatteredInterpolant function would be my first recommendation, and ...

5 years ago | 0

Answered
Plot time on x-axis with certain intervals
Try something like this — tdr = duration(minutes(1:250000)); tdt = datetime([2021 01 01])+tdr; % Q1 = t(1435:1445) y = si...

5 years ago | 0

| accepted

Load more