Answered
Create function for matlab code
See the documentation section on Function Basics.

4 years ago | 0

Answered
How to take the fft of a sum of exponentials?
I’m not certain what you want to do. The sum function produces a scalar result if ‘t’ and ‘A’ are the same size, so the Fourier...

4 years ago | 1

| accepted

Answered
scaling axes on plot
There are several options, the easiest of which is to use the surf function rather than imagesc to plot it. %set up variables...

4 years ago | 0

Answered
how import xls file in matlab
I would use readtable or readmatrix to import it, and scatter to plot it.

4 years ago | 1

Answered
Using Matlab ifft() to convert an exoprted frequency spectrum csv from other tool, how to get right amplitude ?
The signal has an extremely high level of broadband noise, and the recovered time domain signal reflects that. One option to ...

4 years ago | 0

Answered
Stresses around an edge dislocation equation/plot contour
See my Comment to a different question on exactly the same problem.

4 years ago | 0

| accepted

Answered
Removing spikes with standard deviation
Without the data, it is not possible to determine the reason the code does not work. See if the rmoutliers function (introduc...

4 years ago | 0

| accepted

Answered
Two strcmp conditions in one if statement
‘I don't get any errors when I run the code, I simply get blank doubles for each of the timepoints.’ That would indicate to m...

4 years ago | 0

| accepted

Answered
Why do I get an error when I try to use the solve function?
The quoted character array notationi may no longer be usable. Try this isntead — syms x y [x,y] = solve(x+2*y == 4, 2*x -...

4 years ago | 0

| accepted

Answered
I have an Excel file having sample data and magnitude, I want to convert the time domain to frequency domain using FFT, The file is attached
It is probably not giving the desired result because the fft is truncated to 1024. Ths signal is much longer than that, and the...

4 years ago | 1

Answered
Is it possible to do a search in a table for a value nearest to a number I want?
Your quesiton is a bit ambiguous, so I am not certain what result you want. Try this — array = [1 3; 2 4; ...

4 years ago | 0

Answered
Fractions in "fprintf"
Try using the rats function — x=0.25; y=0.75; strlen = 3; fprintf('This is the Optimal Solution: [%s, %s]\n', rats(x,strl...

4 years ago | 0

| accepted

Answered
Is there a way to create subscripts in the script editor?
The only way I am aware of to display subscripts is described in Matrix Indexing. If you intend something else, please be speci...

4 years ago | 0

| accepted

Answered
How to export a table including column names?
It might be better to write it as a text file instead, since a .csv file may not be appropriate. writetable(MyTable,'MyTable...

4 years ago | 2

Answered
De-noising of speech signal using IIR filter
First, use the fft or pspectrum function to see what the spectral content of the signal is. If the noise is band-limited (occup...

4 years ago | 1

Answered
How to change the relative scaling of my x-axis
See if the semilogx function produces the desired result.

4 years ago | 1

| accepted

Answered
I want to integrate this function
Use the integral function — x = 0:50; y = @(x) exp(-x./25).*sqrt((25+x)/(25-x)); int_y = integral(y,0,50) The cumtrapz (o...

4 years ago | 0

| accepted

Answered
What is the difference between strjoin and join?
The join function (introduced in R2016b) is primarily intended for use with the string data type, introduced at the same time. ...

4 years ago | 0

| accepted

Answered
Unrecognized function or variable 'helperDownloadData'. This error shows when I run my code
That call appears to be in the example Detect, Classify, and Track Vehicles Using Lidar so using it requires having the Lidar To...

4 years ago | 1

Answered
Plot legend and axis label does not display
Spaces are significant in name-value pair arguments, so ' Interperter ' will not be recognised. %% Sample points considering ...

4 years ago | 0

Answered
Put Zero Value randomly in wave function
Try something like this — %Sine wave freq=400; Amp=2; t_samp=1/8000; T=0.01; t=0:t_samp:T; y=Amp*sin(2*pi*freq*t); y(r...

4 years ago | 0

| accepted

Answered
plotting graph using symbolic equation
None of the variables are explicit functions of frequency. They must be functions of frequency and have all the other values de...

4 years ago | 0

Answered
Shuffle the rows and columns
Do exactly what you described — M = [1 2 3 4 ; -1 -2 -3 -4 ; 1 2 3 4 ; -1 -2 -3 -4] Ms = M([1 3 4 2],[3 2 4 1]) .

4 years ago | 2

| accepted

Answered
who does logical works
The assignment: x(mod(x,2)==0)=5*x(mod(x,2)==0) finds numbers tthat are evenly divisible by 2 (so the remainder after divisio...

4 years ago | 0

| accepted

Answered
How to save image of cqt (Constant-Q nonstationary Gabor transform) from KHz to Hz
Try something like this — load handel figure cqt(y,'SamplingFrequency',Fs) Ax = gca; ytv = Ax.YTick; Ax.YTickLabel = comp...

4 years ago | 0

| accepted

Answered
Can anyone help me out what does sign(rand-0.5) command mean
The ‘sign(rand-0.5)’ returns the sign (-1,0,1) of that result — for k = 1:10 r = rand X = sign(r-0.5) end .

4 years ago | 1

| accepted

Answered
How Do I Remove Scientific Notation From X/Y Axes on Plot
Perhaps something like this — x = logspace(-6, -2, 250); y = sin(2*pi*3*x/x(end)); figure semilogx(x, y) grid figur...

4 years ago | 0

Answered
mathematical basis of Polyarea calculation
To see how it works, run this — type polyarea Whatever you do, do not open it in the Editor in order to see the code! This r...

4 years ago | 0

| accepted

Answered
FFT gives wrong answer for a generating function
It is possible to get close to the desired result by ‘adjusting’ the fft arguments — n = 50; f = linspace(-pi, pi, n); % ...

4 years ago | 0

| accepted

Answered
Is there a built in function like MinPeakHeight but for maximum numbers?
Another option is the islocalmin function (introduced in R2017b).

4 years ago | 0

Load more