Answered
Call out specific data columns to use in function.
I would do something like this: function [m,BG] = av(x) xsel = x(:,[4 10]); m = mean(xsel); figure BG = bar(m); end sa...

6 years ago | 0

Answered
fread returns -1
Since 'long' indicates a 32-bit signed integer, and you are returning 1 value, that is likely what the function is reading. T...

6 years ago | 0

Answered
Error in fminsearch (line 200)
I did not run this. However ‘f’ is already a function handle, so try: min3 = fminsearch(f, x0); .

6 years ago | 0

Answered
second order differential Equation
The symbolic Math Toolbox no longer uses strings. That threq the warning. For the rest: % % y''(t) - 6 * y'(t) + 9 * y(t) ...

6 years ago | 0

Answered
How to determine optimization solution of dependent variables corresponding to minimum sum of squared errors?
I believe (although am not certain) that what you are describing is nonlinear parameter estimation. For that, you nneed to have...

6 years ago | 1

| accepted

Answered
Cutting a signal into segments
Use the buffer function on each vector to partition it: v = randn(1,30352); % Create Signal Ve...

6 years ago | 1

Answered
2nd order butterworth filter and PCA
With respect to downsampling, use the resample function. I wouldn’t downsample the signal unless you absolutely must for some r...

6 years ago | 1

| accepted

Answered
Further Explanations on Matlab
There are several available resources. One is Getting Started.

6 years ago | 0

Answered
Taking a weekly average of a datenum dataset
The timetable function will likely be helpful.

6 years ago | 0

Answered
white gaussian noise and bandwidths
The problem is simply with your understanding of the randn funciton. It generates normally-distributed random values with a var...

6 years ago | 0

Answered
Graph plotting of ODE with time variable
None of the initial conditions are defined (nor are ‘kon’ and ‘koff’), so the initial conditions will be replaced by symbolic co...

6 years ago | 1

| accepted

Answered
fitnessfcn: Not enough input arguments.
It would help to see your ga call. When I run your function using this ga call: Xest = ga(@objfun, 4) it produces (in one ...

6 years ago | 0

Answered
How do I get the differential of Hermite polynomial function?
Did you run the code you posted? When I run it (in R2020b): syms m1 x DHx = diff(hermiteH(m1, x),x) I get: DHx = 2*m1...

6 years ago | 0

Answered
Isolating a phase bode plot from the function bode(sys)
It would be easier to just get the output and re-plot it. See Obtain Magnitude and Phase Data.

6 years ago | 1

Answered
How to format numbers in exponential notation with base 1e3
This will correctly calculate tha mantissas: rfxm = @(x,xpnt) [sign(x).*10.^(log10(abs(x))-xpnt)]; % Anonymo...

6 years ago | 0

| accepted

Answered
Practical use of Phase Delay for IIR Filter on Pure Sinusoid
To avoid the phase shift, use the filtfilt function instead of filter.

6 years ago | 0

| accepted

Answered
Plot serial date of excel into MATLAB
The first column is numeric representation of yyyymmdd so there are likely several ways to create a datetime array from it. T...

6 years ago | 3

Answered
Why is the following numerical integration not working?
Try this: TMD = integral2(@Optics,0,2,0,2*pi); (I did not run your code, so there may be other errors as well.)

6 years ago | 1

Answered
How to curve fitting a cosine function with exponential decay tau?
Try this: y = detrend(y); % Remove Linear Trend yu = max(y); ...

6 years ago | 2

Answered
how to make group by extracting data?
I am not certain what you want to do. One problem is that the elements of ‘CM’ appear to be outside the range of (-9,9). In an...

6 years ago | 0

| accepted

Answered
Count the number of times a value appears in a row and save the row number
Try this: rowsum = sum((A <= 1.5), 2); result = find(rowsum >= 3) producing: result = 1 2 3 4 ...

6 years ago | 0

| accepted

Answered
How to extract specific data?
Try this: a1 = [10 20 30 40 50 60]; b1 = [11 21 31 41 51 61]; c1 = [12 22 32 42 52 62]; e = [0 3 6]; abc = cat(1, a1, b1, ...

6 years ago | 0

| accepted

Answered
ı want to plot he gradients and iso curves of a function
See How to plot gradients ? for a recent example.

6 years ago | 0

| accepted

Answered
quadratic equation function help
Your function file must be saved somewhere on your MATLAB user path as: quadFunc.m so you can use it. If you are unfamiliar w...

6 years ago | 0

Answered
Plotting Multivariable x, y, and z for a data set
The problem is with your choice of coordinates. When I ran your code, it threw: Warning: The underlying triangulation is em...

6 years ago | 0

| accepted

Answered
Find z value out of x and y values from a countour in command window
Clicking on the contours will only show you the level of the contour. To see the value labels of the contours use ShowText: c...

6 years ago | 0

Answered
Solving (non-linear equation) for a single unknown?
If you want to use the Symbolic Math Toolbox for this, use solve not fzero: syms M P4 = 0.448159 P1= 0.101325 y=1.4 equ1...

6 years ago | 1

Answered
3d graph to compare curves with given x, y, z values
Try something like this: x = 0:31; y = 0:8; [X,Y] = ndgrid(x,y); % Create [X,Y] Grids Z1 = 2...

6 years ago | 0

Answered
What does the 'metric' parameter means in imfindcircles?
It means how ‘round’ the objects are. See Step 5: Determine which Objects are Round for a more complete description.

6 years ago | 0

Answered
How to calculate 90% confidence interval
Use the paramci funciton: abc = readmatrix('abc.txt'); Inabc=log(abc); pd = fitdist(abc,'Normal') ci10 = paramci(pd, 'Alpha'...

6 years ago | 0

Load more