Answered
spectrogram unit change from dB/Hz to linear scale
If you want dB rather than dB/Hz, use the pspectrum function with the 'spectrogram' option argument. To get magnitude from dB...

3 years ago | 0

Answered
Why doesn't timezone work with datetime
The timezone function is from the Mapping Toolbox, and its results are not compatible with the datetime function. The otherwise...

3 years ago | 1

| accepted

Answered
Why damping amplitude the amplitude shifting position of y azis
It would help to have the file to demonstrate with it, however that may not be absolutely necessary. The signal in the file (...

3 years ago | 0

| accepted

Answered
Evaluating a complex equation
Preallocate ‘Y’ as: Y=zeros(8,numel(t)); add a second dimension to ‘Y’ in the assignment to it: Y(n,:) = ... and add ‘t’ t...

3 years ago | 0

| accepted

Answered
Why low pass filtering requires long duration time signals?
1. The problem with needing long signals is primarily due to using an FIR filter, since FIR filters are usually long in order t...

3 years ago | 0

Answered
Concatenating Arrays end to end 1D
One option is to convert ‘Duplicates’ to a cell array (using num2cell) to make it compatible with the other values — Blank='-'...

3 years ago | 0

| accepted

Answered
wny fft does't work with different signal?
Thbere is a farily significant D-C or constant offset in ‘data(:,2)’ and that hides all the spectral peaks of lower magnitudes. ...

3 years ago | 0

| accepted

Answered
How to find the intersection values of line and curve?
Try this — % clc % close all d1 = 0.4;d2 = 0.6;d = d1 + d2; n1 = 3.46;n2 = 1.5; lambda = linspace(400e-3,800e-3, 100000)...

3 years ago | 0

| accepted

Answered
color map with specific range
I used 'filled' here because otherwise the yellow points may be difficult to see — figure imshow(imread('tri.jpg')) x = 1:...

3 years ago | 1

Answered
look up data from table (either from excel, table in matlab, or text fil) using App Developer
Another option for the lookup — Table = readtable('FluxDataInterpolated.xlsx'); inclination = Table{1,2:end}; altitude = Tab...

3 years ago | 0

Answered
The least square with changing number of lines of matrix
I am not certain what you want. This calculates regressions on each column of ‘y’ and then plots it in the same colours as th...

3 years ago | 0

Answered
Create a 3D plot with shadow length, altitude, and time.
Filling the inside of the 3D curve is straightforrward — run('shadecode.mlx') T1 = readtable('Shadedata.xlsx') t = T1.Time...

3 years ago | 0

| accepted

Answered
Failure on combining 2 timetable
Experiment with the synchronize function to see if it will do what you want. EDIT — (21 Aug 2023 at 15:57) To illustrate —...

3 years ago | 0

| accepted

Answered
System response from input and output signals
First, use the System Identification Toolbox (iddata then ssest and compare then lsim) or the Signal Processing Toolbox (invfreq...

3 years ago | 0

| accepted

Answered
How to create nested legend
One option is to put each ‘h’ in a separate column — h = 300 : 75 : 525; w = 60 : 30 : 180; [H,W] = ndgrid(h,w); figure...

3 years ago | 0

| accepted

Answered
Averaging data from seconds to three seconds because of different time variables
I am not certain that it is possible, however if it is, some combination of retime and synchronize could work. EDIT — (21 A...

3 years ago | 1

Answered
How to make contour smooth
There are a few options, one being to plot fewer levels, and the second being to downsample the matrix using interp2 and also ch...

3 years ago | 0

| accepted

Answered
Matlab figure: Replace xaxis with custom labels
Another approach — sun = sin((0:240)*pi/25).^2 .* exp(-0.015*(0:240)); figure plot(sun) figure plot(sun) xt = xticks;...

3 years ago | 0

Answered
Interpolation using Excel Data
One approach — % C1 = readcell('FluxData.xlsx') T1 = readtable('FluxData.xlsx') xvar = T1{1,3:end}; yvar = T1{2:end,2}; ...

3 years ago | 0

| accepted

Answered
Read excel file with Matlab
One option is to use the datetime 'ConvertFrom' name-value pair. For the ‘value’ argument, both 'excel' and 'posixtime' work, ...

3 years ago | 0

| accepted

Answered
I hava wav file and need to plot spectrogram in matlab
The argument to spectrogram must be a vector. I suspect the error is that ‘y’ is a (Nx2) matrix, and that is throwing the error...

3 years ago | 0

Answered
Nonlinear Regression using a gaussian in a lattice
One approach (using smaller matrices for efficiency and to demonstrate and test the code) — syms a sigma dr = sym('dr',[3 3]...

3 years ago | 0

| accepted

Answered
Why is NaN inserted in wrong position?
It should not do anything, because 5 is in row 2, not row 1. That aside, you need to index into ‘b’ correctly to get the desi...

3 years ago | 1

| accepted

Answered
passing filenames to a dos command
See if the system function will do what you want. Also, see Run External Commands, Scripts, and Programs for a more extensive...

3 years ago | 0

Answered
how can I plot the contours inside not outside?
What result do you want? Try this — figure F = openfig('untitled.fig'); Lines = findobj(F, 'Type','line'); for k = 1:nume...

3 years ago | 0

Answered
how to include symbol on plot line into the legend?
The code plots two lines, however has only one legend entry, so the second series (with the '<' marker) does not show up in the ...

3 years ago | 0

Answered
How to quickly group numerical data without giving bin sizes
I am not certain that there is a robust approach to this sorts of problem. For multivariable problems (each point is a vector d...

3 years ago | 0

| accepted

Answered
Finding similar rows with different I and M columns and create an average of them
Experiment with the unstack function to see if it will do what you want. (The necessary information is missing, so I cannot run...

3 years ago | 0

| accepted

Answered
How to plot LTspice graph in Matlab in this case?
One approach — T1 = readtable('final_all1.txt', 'VariableNamingRule','preserve') T1.MagdB = str2double(extractBetween(T1{:,...

3 years ago | 1

| accepted

Answered
How to obtain the values of R, L and C of a series RLC model of experimentally obtained frequency domain response data in MATLAB?
This is ‘circuit synthesis’ and it is (unfortunately) not trivial. A series RLC model: >--- R - L - C ---> Vin ...

3 years ago | 0

| accepted

Load more