Answered
How to print a range of numbers to a text file?
Open your files _before_ the loop, and close them _after_ the loop: file_1 = fopen('bell_datain.txt', 'wt'); file_2 = f...

9 years ago | 0

| accepted

Answered
How to find the median in a zero crossing?
Thank you for quoting my code! I am not certain what you intend by ‘median’ zero-crossings. It is straightforward to calcu...

9 years ago | 0

| accepted

Answered
how to sample random data ?
It depends on what you want to do. I would use the Signal Processing Toolbox <https://www.mathworks.com/help/signal/ref/resampl...

9 years ago | 0

Answered
How can i find the peaks of the signal and get a phase and magnitude plot?
The easiest way is to create and plot a _one_-sided <https://www.mathworks.com/help/releases/R2015a/matlab/ref/fft.html *|fft|*>...

9 years ago | 0

| accepted

Answered
How to filter out 1sigma data
I can’t produce your desired output, since that does not match the criterion of data being less than *|1|* standard deviation of...

9 years ago | 0

Answered
colouring dots in scatter3 according z-value
It is relatively straightforward to do what you want: x = rand(10, 1); % Cr...

9 years ago | 5

| accepted

Answered
Can you help remove the noise from this audio file?
It is not possible to eliminate broadband noise with a frequency-selective filter. You have to use wavelets to effectively de-n...

9 years ago | 3

| accepted

Answered
How to solve mass transfer equation with array input
You appear to have a system of differential equations. You need to _correctly_ cast your system as a set of differential equati...

9 years ago | 1

Answered
Axis keep resorting back to -5,5 even after I set xlim
The *|xlim|* call has to go *_after_* the *|plot|* call: fplot(x,f(x)) xlim([0 20])

9 years ago | 0

| accepted

Answered
What do you think A([1,3],[4,1]) refers to?
My best effort to explain it: A=[5 -3 15 6;-1 0 11 4;3 2 -7 1]; Asel = A([1,3],[4,1]) Explanation = [A(1,4) A(1,1); ...

9 years ago | 0

Answered
when i run this script i get an error 'Field assignment to a non-structure array object.' in line 10
Your *|‘str’|* variable is a character array or a *|(1x1)|* *|string|* object, not a structure. You cannot address it as a stru...

9 years ago | 0

Answered
Butterworth lowpass filter design code with a specific cutoff frequency, pass-band and stop-band attenuation
Your filter design defies logic. I do not understand your passband attenuation being greater than your stopband attenuation. U...

9 years ago | 0

Answered
Someone please help me....
a = rand(N, 1)

9 years ago | 0

Answered
making rectangular matrix by non rectangular matrix by putting zeros
One approach: c = {[1 1]; 2; [3 2 2 4 2 2 2 3 3]}; % Original Cell Array (Segment) szc = cel...

9 years ago | 0

| accepted

Answered
How to plot 2 lines and find the coordinates of their intersection?
Another approach: xymtx = [1 1; 1 -1]; cv = [3; -1]; xy = xymtx\cv; % Calcul...

9 years ago | 2

Answered
Mean and Std in Subplot Graphs
I would plot them as: plot(xlim, [1 1]*ym1, '-r', xlim, ym1+[1 -1; 1 -1]*ys1, '-g') and so for the others. This...

9 years ago | 0

Answered
Help with Amplitude Spectrum of Fourier Tranform
If you simply want to plot vertical lines, the best option is to use the <https://www.mathworks.com/help/matlab/ref/stem.html *|...

9 years ago | 0

| accepted

Answered
Can I count the number of integers in an index and store it in a variable?
Yes. Xeq1 = numel(index); This is how I would do it.

9 years ago | 0

| accepted

Answered
xlsx to matlab and plot
I would use the *|xlsread|* funciton (preferably) to read it to a matrix, or the *|readtable|* function to read it to a table. ...

9 years ago | 0

| accepted

Answered
How to select two data of minimum above and below
This works: M = [1.2 4.3 0.2 9 2.7 4.6 1.3 11 2.7 2.2 4.6 2 0.2 4.1 3.0 12 0.4 5.3 2.6 1 ...

9 years ago | 0

| accepted

Answered
How to plot y(n) over the range of 0<n<50. the equation given is y(n) = 1.97y(n-1) - y(n-2)
Since the limits are stated, I would just use a *|for|* loop: y(1) = 0; y(2) = 1; for n = 3:51 y(n) = 1.97*y(...

9 years ago | 2

| accepted

Answered
polar plot being reflected
Plot the _absolute_ value of *|‘R’|*: polarplot(theta,abs(R),'r'); That should produce the plot you want.

9 years ago | 3

| accepted

Answered
How do you change an entire row or column of an array to a certain value
One option: N = 5; X = zeros(N); X(:,3) = rand(N, 1); % Change Column #3 To...

9 years ago | 0

| accepted

Answered
change scaling of x-axis
Try this: x = 0:260; % Create Data y = rand(size(x)); ...

9 years ago | 5

| accepted

Answered
Definite Integral with symbolic upper and lower limits and a constant
Try this: syms k v v0 assume(v > 0) assume(v0 > 0) g(k,v) = (1/-k)*(1/v); % Symboli...

9 years ago | 1

| accepted

Answered
How to Normalize a fft to plot in frequency domain?
I am not certain what you intend by ‘normalise’. You need to scale it by dividing the *|fft|* result by the length of the time-...

9 years ago | 1

| accepted

Answered
How to find signal frequency using find function
It is possible, although not straightforward, since you need to use *|find|* to determine the _period_, that you can then conver...

9 years ago | 0

Answered
The complex number integration
I would eliminate the *|abs|* call until the end, using it on the integrated function only _after_ you evaluate it numerically. ...

9 years ago | 0

| accepted

Answered
How do I make matlab estimate the best function to descibe different lines in a graph?
There may not _be_ a function for those plots, since they could have been derived from experimental data. Probably the best you...

9 years ago | 0

Answered
Substituting and evaluating function
Try this (in *|R2012a|* and later): syms x X = sym(140); der(x) = (13459*cos((313*x)/200 - 1689/2000))/25 + (42471*...

9 years ago | 0

| accepted

Load more