Answered
Convert audioread file to obtain spl
Use the Audio Toolbox function splMeter.

4 years ago | 0

| accepted

Answered
Adding Non-Plotted Items to Figure Legend
Perhaps something like this — x = 1:20; y(1,:) = 0.5+randn(size(x))*0.1; y(2,:) = 0.5+randn(size(x))*0.1; figure plot(x,...

4 years ago | 0

Answered
Hi. I am having issues with having my matlab get past the ifourier part of my code. It just continually runs and is stuck at that part. The bold is where my computer is stuck.
It seems to work here — m = 10; % kg k = 15; % N/m b = 8; syms x(t) Dx = diff(x,t); h_eqn = m*diff(x,t,2) + b*dif...

4 years ago | 0

Answered
function answer is displayed twice
‘How do I get rid of the ans= part being displayed as well?’ Perhaps: calcMax; (added semicolon) .

4 years ago | 0

Answered
title plot can't be shown + grid
The title and grid functions do not apply until the axes are created. Also, there are two ‘subplot(2,3,1)’ creations, the secon...

4 years ago | 0

| accepted

Answered
How to integrate using the for loop?
No loop necessary — LD = load(websave('V1','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1172553/V1.mat')); ...

4 years ago | 0

Answered
Errors in loops in Matlab
Perhaps you intended: k(t+1)=alpha*k(t)^(alpha-1)+(1-delta)*k(t)-c1(t); ↑ instea...

4 years ago | 0

Answered
find Maximum values in intervals of time(each 2000 values)
It would help to have the data. Try something like this — u = randn(1, 24001); t = 1:numel(u); r = 2000; U = zeros(r,c...

4 years ago | 0

| accepted

Answered
Predict power consumption using linear regression
There are 89 days in the data, so the data ‘wrap’ to 24 hours. T1 = readtable('https://www.mathworks.com/matlabcentral/answer...

4 years ago | 0

| accepted

Answered
Using regular expressions to filter files
There appears to be only one comma (,) in each line, so perhaps the extractAfter function (introduced in R2016b) will work. C...

4 years ago | 0

| accepted

Answered
How do I change the direction of the numbers on my axis.
I’m not certain what you want, however something like this may do what you want — x = linspace(-1, 1, 10); y = (x+1).^2; f...

4 years ago | 2

Answered
readmatrix command is not working.
The readtable function was introduced in R2013b, and the readmatrix funciton in R2019a. If you do not have readmatrix, see if...

4 years ago | 1

| accepted

Answered
How to derive and plot derive for a set of data with non linear x axis?
I have no idea what the data are. Calculationg the numerical derivative is straightforward with the gradient function — x =...

4 years ago | 0

Answered
Extracting Data from a .fig File
This should do what you want — F = openfig(websave('Group10%20heating','https://www.mathworks.com/matlabcentral/answers/upload...

4 years ago | 0

Answered
How to convert rows to logical
Why not just: A = 1:10; %fitering happens r = [2 7 8]; %the rows to keep Afiltered = zeros(size(A)); Afiltered(r) = A(r) ...

4 years ago | 1

| accepted

Answered
How to plot lines with unordered data points?
One approach — LD = load(websave('xydata','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1171138/xydata.mat')...

4 years ago | 0

| accepted

Answered
How can I plot this function?
This requires a surface plot with separate plots for the real and imaginary components — lambdaI = randn; ...

4 years ago | 0

Answered
Find peaks in a for loop?
The maxk and mink functions (introduced in R2017b) would make this a bit more efficient. Lacking them, use sort. Try this — ...

4 years ago | 0

| accepted

Answered
How to calculate peak value and duration of signal in Image
The indexing in the image makes this a challenge, since they reflect back and in any event are non-monotonic, eliminating a stra...

4 years ago | 0

Answered
Unable to resolve the name 'fdesign.lowpass'
Run these commands from a script or the Command Window: restoredefaultpath rehash toolboxcache then try it again. If yo...

4 years ago | 1

| accepted

Answered
For-loop using only last iteration
It is necessary to index into ‘C’, however I do not know what you want as the result. % clearvars; C = zeros(1,10); %Create ...

4 years ago | 0

| accepted

Answered
Piecewise Function Surface Plot
They are not seamless because the first surface ends with Z=1 and the second begins with Z=2. Change the constant in the second...

4 years ago | 0

Answered
Add Bar over Letter x for mean value symbol
Use '$\bar{x}$' to get: .

4 years ago | 1

Answered
I would like to know how can I plot amplitude and phase
I tweaked your code slightly. Try this — t=1:0.07:20; x=sin(t)+sin(t).*cos(t); Fs = 1/0.07; ...

4 years ago | 0

| accepted

Answered
How to extrapolate an x value from a fitting curve?
You can eliminate the monotonicity problem by first selecting the region of the desired value — xvalues = [10; 12; 22; 28]; y...

4 years ago | 0

Answered
Matlab matrix syntax weird
It is likely easiest to assign a value to ‘height’ and ‘width’ and see the result — height = 4; ...

4 years ago | 0

Answered
Add new "datetime" elements to an existing cell array (matrix)
I am not certain what a more universal end result would look liks, however this seems to work for this problem — a = cell(3,3)...

4 years ago | 1

| accepted

Answered
Finding value of x given y in a model fit to normcdf
Perhaps something like this — yValues = [0.3333 0.5000 0.8333 1.0000 1.0000 0.8571]; xValues = [1.4000 1.80...

4 years ago | 0

Answered
How to fix error about interp1?
It would be helpful to have ‘wtemp’ and ‘wdepth’ to experiment with, as well as a description of what you want to do. It may ...

4 years ago | 0

Answered
EMG signal to segmnent
Use the buffer function for part of this — EMG = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/11...

4 years ago | 1

| accepted

Load more