Answered
Can integral3 be used to have integrals over 9 variables?
A 3D vector would seem to me to be a 3D matrix. If so, trapz used repetitively on each dimension of the matrix would likely be ...

3 years ago | 0

Answered
plot a graph from user input
Use the inputdlg function instead. You can list everything you want responses to in one call to it, and even create default opt...

3 years ago | 0

Answered
I would like to count the number of peaks of a signal.
Use the signal Processing Toolbox findpeaks function to count the peaks. The plotted signal does not appear to be noisy, so it ...

3 years ago | 0

| accepted

Answered
How make a high pass filter and give input to it simultaneously?
‘There are functions on matlab like Highpass but it doesn't pass an input signal into it.’ Yes, it does! The input signal ...

3 years ago | 0

Answered
Fixing fzero in standard normal distribution
Change the initial parameter estimate to something other than 0. The fzero function is a root-finding algorithm, so it looks fo...

3 years ago | 1

| accepted

Answered
Choose frequency to plot and create sound
These frequencies are going to be too low to hear, so consider multiplying them by perhaps 100 in the sound call. Fs = 44100...

3 years ago | 0

Answered
How can I add error bars to a stacked plot?
A (slightly tortured) tiledlayout array might work — x = 0:0.5:10; y = randn(3,numel(x)); err = randn(3,numel(x))/5; figu...

3 years ago | 1

| accepted

Answered
Save results if fminsearch in a table or m.file
I assume that ‘a’, ‘xi’, and ‘phi’ are parameters returned (in that order) by fminsearch. If so, then perhaps this — U_v...

3 years ago | 0

| accepted

Answered
lsqnonlin providing very poor model fits
With a few edits to make it more efficient, this seems to work — A=lsqnonlin(@insulin_prediction,[2 2 2 2],[0 0 0 0]) functio...

3 years ago | 0

| accepted

Answered
butterworth and baseline removal filtering
The ‘baseline wander filter’ is a bandpass filter with a passband of 0.5 to 15 Hz. (This is too restrictive in my opinion. The...

3 years ago | 0

Answered
How to use Nlinfit for a function with two independent variables?
You are using the correct approach with: xm=[x1 x2]; In the function, refer to ‘x1’ as ‘xm(:,1)’ and ‘x2’ as ‘xm(:,2)’ , pas...

3 years ago | 0

| accepted

Answered
Warning: Error updating FunctionLine. for fplot
Evaluate all the functions. Try this — y1 = 0; addi = 0.05; aoamid = (2*0.6*sqrt(1-((y1)/4)^2)/(pi^2)+0.6/(8*pi)) CLnew ...

3 years ago | 0

Answered
Having trouble creating a for loop for this code. I want to use a for loop instead of having five commands as seen in the code.
Perhaps — prefx = {'r','f','g','l','x'}; for k = 1:numel(prefx) data{k} = load(sprintf('%s.dat',prefx{k}) end prefx = ...

3 years ago | 1

| accepted

Answered
Grouping Categories in Scatter Plot
The gscatter function may be appropriate. Is this the correct file? These don’t appear to have anything to do with rivers (a...

3 years ago | 0

Answered
R2022B Update4 is not offered
Try this — Get R2022b Update 4 That’s where I had to go to get it. .

3 years ago | 0

Answered
matlab does not plot the time series
The problem is that ‘velocity_jonswap’ is uniformaly NaN. This is causec by a ‘0/0’ , ‘Inf/Inf’ or NaN values in the data used ...

3 years ago | 0

| accepted

Answered
how can i plot including sym data in graph?
Thia approach works — fs=3000; t= 0 : 1/fs : 10; t = 0: 1/fs : 2.5; % Substitute To A...

3 years ago | 0

| accepted

Answered
Same calcuation, but hand-result is different from code result
This simply appears to be a precision issue. Using round on the intermediate results provides the same result as the calculator...

3 years ago | 0

Answered
How to extract column index based on value in another column?
Try something like this — A = [2 4 1 3 2; 3 1 4 2 3; 2 4 1 3 4; 4 2 3 1 4; 1 3 2 4 4]; T1 = array2table(A, 'VariableNames',{...

3 years ago | 0

| accepted

Answered
How to assign 0 or 1 randomly to the coordinates?
I am not certain what you want to do. Perhaps this — x = linspace(-2,2,10) ; y = linspace(-2,5,10) ; [X,Y] = meshgrid(x,...

3 years ago | 0

| accepted

Answered
How do I save a SINGLE value from the workspace?
‘Hi, is a data type 2x99. I need save the value x(:,1) when x(:,2) is near to 0. How I save this date.’ It depends what ‘near...

3 years ago | 0

Answered
Matlab bode plot with specific cut off frequency
The easiest option may be to define the radian frequency function: w = linspace(0, 1.5E+4, 1E+3)*2*pi; and then supply it as ...

3 years ago | 0

Answered
Keep getting a blank graph
First, you only use the first 0.06 seconds of the torque vector, so create a file with just those values. (I did that offline, ...

3 years ago | 1

Answered
Where is the option "Allow unstable model"
The only reference I can find (requiring an Interweb search) is step 6 in Estimate Transfer Function Models in the System Identi...

3 years ago | 0

| accepted

Answered
Multiplication matrix with strings
Perhaps this — syms k1 k2 m M = [k1-2*m,-k2;-k2,k2]*[1,2;4,6] % Symbolic Expression Mfcn = matlabFunction(M) ...

3 years ago | 0

Answered
How to find largest Peaks Values of signal and Save Corresponding X axis and Y Axis Values in MATLAB
Try this — LD = load('Dataset20230221.mat'); Dataset = LD.Dataset; X = Dataset(:,1); Y = Dataset(:,2); [pks,locs] = find...

3 years ago | 0

Answered
How to generate model output given a transfer function and input signal
If you have the time vector and the matching input vector, use the lsim function to generate the output, however a more robust a...

3 years ago | 1

| accepted

Answered
How to perform derivative of a random signal without finite difference schemes?
The derivative operation is by definition a highpass filter, and so will accentuate the noise. One option might be to filter th...

3 years ago | 1

| accepted

Answered
lscurve fit problem issue in Money Rivlin model
I am not certain what you want to do. Two independent variables may require one or two dependent variables, however with only...

3 years ago | 0

| accepted

Answered
Return a value in csv data at a specific point
Try this — T1 = array2table([sort(randi(1E+4, 12,1)) rand(12,1)*1E+3], 'VariableNames',{'Distance','Depth'}) Dep = interp1(...

3 years ago | 0

Load more