Answered
How to plot a symbolic equation
Using piecewise (R2016b and later versions) may be an option.

6 years ago | 1

| accepted

Answered
summation of 2 Sine waves
It does show a straight line at zero. Look at the magnitude of the y-axis (±2E-15), and you will see that it is essentially plo...

6 years ago | 1

| accepted

Answered
How can I create this image?
Try this: [X1,Y1,Z1] = cylinder; X2 = bsxfun(@times, X1, [1.2; 0]); Y2 = bsxfun(@times, Y1, [1.2; 0]); figure Ax = gca; ...

6 years ago | 0

| accepted

Answered
Sampling Audio at 11025 sample/sec in MATLAB
See: Record and Play Audio for a full description of the process. Note that SampleRate defines the sampling frequency.

6 years ago | 0

| accepted

Answered
I'm unable to derive a function with decimals
Use the vpa function: vpa(diff(Y)) .

6 years ago | 0

| accepted

Answered
Find missing dates from a file
Try this: fidi = fopen('Dates.txt'); D = textscan(fidi, '%{dd/MM/yyyy}D') fclose(fidi); AllDates = (D{1}(1):caldays(1):D{1}...

6 years ago | 0

| accepted

Answered
Help with some fft problems, can't come up with a better title
You need to force the index arguments to be integers. One option: plot(Y(1:fix(length(Y)/2))); There are others, dependin...

6 years ago | 0

Answered
How can I change the radius of the spiral so it varies along the length from 0 to 1?
Change ‘x’ and ‘z’ to: x=cos(y/100*10*pi).*(y/100); z=sin(y/100*10*pi).*(y/100); so the full code siis now: y=0:0.5:100; ...

6 years ago | 0

| accepted

Answered
How to get spectrogram of an array in MATLAB?
The documentation states that the input signal is ‘specified as a row or column vector’, so you would need to loop through each ...

6 years ago | 0

| accepted

Answered
Why can't I automatically get an integer from this simple function?
You have encountered floating-point approximation error. See Floating-Point Numbers for an extended discussion. The differen...

6 years ago | 0

| accepted

Answered
How can I find integral of a 3-D mesh field?
See if using trapz on one or both dimensions of your matrix will do what you want.

6 years ago | 0

Answered
Executing a multiple plot graph
Change to: plot(x, -1.2e8*a/25*x + 1.2e8*a) and it should work.

6 years ago | 0

| accepted

Answered
Troubles with Butterworth Bandpass filter
My expertise in this area stops with the filters and thier implementations. An appropriate time vector: Fs = 1000; L = num...

6 years ago | 0

Answered
i want to solve this equation
See if this does what you want: a = sum((x - mean(x)).*y) / sum((x - mean(x)).^2); .

6 years ago | 0

Answered
Area in 3-D temperature plot
Apparently, the contour3 call plots temperature contours as a function of longitude and depth. You can specify the levels at wh...

6 years ago | 0

| accepted

Answered
Why is there an offset in my butterworth and cheby filters when they have the same values?
There is not really much difference. It is necessary to get the matching frequency vector (‘wh’ and ‘wc’ here) from the freqs f...

6 years ago | 0

Answered
Fast Fourier Transform with discrete data
I suspect the first column of ‘data’ is a time vector and the second column is the signal vector. If that is correct, try thi...

6 years ago | 1

| accepted

Answered
how to use lsim
The lsim function will work to get the step response of a system, however the step function is particularly designed to do this....

6 years ago | 1

| accepted

Answered
Butterworth filter: Number of coefficients?
The first argument to butter is the filter order, and the number of coefficients in the transfer function vectors will be 1 les...

6 years ago | 0

| accepted

Answered
How to I plot Laplace transfer function characteristics using the symbolic toolbox?
Here, ‘s’ needs to be complex: syms s; H = 1/(0.001*1j*s+1); figure; fplot(20*log10(abs(H)), [0 100000]); % set(gca, 'XScal...

6 years ago | 1

| accepted

Answered
i want to use the function intersect with repetition in the results
The ismember function may be an option.

6 years ago | 1

| accepted

Answered
Accelerometer Filtering Causes Ripple
‘P.s. @StarStrider you seem to be the guru for this so i hope you see it!’ I’m, a physician and biomedical engineer, so I’ve de...

6 years ago | 0

Answered
Interpolate/Adjust to new Sampling Rate
Use the Signal Processing Toolbox resample function. The advantage it offers over simply interpolating is that it uses an anti-...

6 years ago | 1

| accepted

Answered
Distributing a cell array into another
Adding end spaces to each character array in ‘A’ and converting them to string arrays: A = {'Category1 ', 'Category2 '}; B = ...

6 years ago | 0

| accepted

Answered
How to obtain max value form Matrix A B C , and write to Matrix D
First use the cat function to concatenate them, then use the max function over the third dimension: D = max(cat(3, Matrix_A, M...

6 years ago | 0

| accepted

Answered
Connecting dots in a plot
Try this: gama=2.8; Hmo=2; % Constants definitions: time=20; % Measurement time f1=0.02; f=f1:f1:time; % eta=1:f1:time; ...

6 years ago | 0

Answered
How to create cuboid with known parameters?
See if: Plot a Cube centered at the origin can provide some inspiration.

6 years ago | 1

| accepted

Answered
how to plot on the same bode plot a manual function plot() with function bode()?
I am not certain that what you want to do is possible with the bode function. The best option is to use the example in Obtain M...

6 years ago | 1

| accepted

Answered
Creating 2D contours from XYZ values
This is likely the best you can do: xv = linspace(min(x), max(x), numel(x)); yv = linspace(min(y), max(y), numel(y)); [Xm,Ym...

6 years ago | 1

| accepted

Answered
Centering different yaxis plots at the same point
Subtract the first y-value from each one and they all should begin at 0. Example — x = sort(rand(5, 20),2); y = randi(20, ...

6 years ago | 0

| accepted

Load more