Answered
How do i find the amplitude of a peak in my plot?
‘I want to find the peak with the most height(not the maximum y value, but the distance from the local minima just before the pe...

7 years ago | 1

| accepted

Answered
fprintf in a for loop
I would do something like this: N = 12; k = 2; for i = 1:N-1 w(i) = k^i; w(i) end fid = fopen('Test2.txt', 'w');...

7 years ago | 2

| accepted

Answered
P values of fitting constants using FMINCON function
If you have fmincon, then you also have lsqcurvefit. Assuming you have constraints that lsqcurvefit can accommodate, use it to ...

7 years ago | 0

Answered
Is there a way to find the exact roots of a fitted function?
It would appear to be relatively straightforward. Since the function is 0 at: c*x + d = 0 and ‘a’ appears to be 0 or close...

7 years ago | 0

| accepted

Answered
Graphing does not appear
The plot will appear if you subscript ‘Bf’: for i=1:numel(t) %There are 216 months in 18 years, incrementing by 1 so per month...

7 years ago | 0

Answered
how can i plot this data?
My code works just as well now as it did earlier, alghout you need to change this assignment back to the way I had it originally...

7 years ago | 0

Answered
How can I display the maximum 10 elements in an array?
If you have R2017b or later, the maxk (link) funciton is an option. I’m not certain how compatible it is with with image data, ...

7 years ago | 0

Answered
how to save all the loop values?
Try this: fv = 48000:49000 e = -1.5099 for k1 = 1:numel(fv) % e % f f = fv(k1); h(k1) = ...

7 years ago | 0

Answered
Trying To Plot a 3D shape
You need a second output from meshgrid in order to plot ‘yy’ correctly. Try this: x = 0:0.01:1; [xx1,xx2] = meshgrid(x); ...

7 years ago | 1

| accepted

Answered
How to find a system's transfer function (Control Systems Toolbox)
With respect to characterizing your system in transfer function form, it would likely be best to begin with a state-space repres...

7 years ago | 0

Answered
what is the meaning of these random numbers
it is giving you a (5 x 16) matrix of ASCII values for '0' and '1'.

7 years ago | 0

Answered
if statement for a matrix
Use ‘logical indexing’: x = 1 : 72; y = rand(1, 72); mv = (x>10) & (x<25); figure plot(x(mv), y(mv)) grid xlim([min(x)...

7 years ago | 1

| accepted

Answered
Issue with fzero command when finding when the 2 curves are first equal.
Your data are not described by functions (including anonymous functions), so fzero is likely not appropriate. You can find the ...

7 years ago | 0

| accepted

Answered
euclidean distance of 2 matrices
If I understand what you want to do, you can use the pdist2 (link) function to calculate the Euclidean distance between ‘D’ and ...

7 years ago | 0

Answered
Help with using fprintf and matrices
It is usually necessary to experiment. Try this: fprintf(formatspec,[R',SA',V']') or equivalently: fprintf(formatspec,[R;...

7 years ago | 0

| accepted

Answered
creating matrix with the same size for different variables
Try this: x=linspace(eps,pi/2,200); D11=1+sin(x)-cos(x); D12=1-sin(x)-cos(x); D21=1-sin(x)+cos(x); D22=1+sin(x)+cos(x); f...

7 years ago | 1

| accepted

Answered
Help calculate areas beneath curves
Another approach, with increased resolution and interpolation: x1=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ...

7 years ago | 1

| accepted

Answered
Solving System of Equations Symbolically
Subtract them: syms a b c d e eqn1= a==b+d; eqn2= a==e+c; eqnarray=[eqn1 - eqn2]; cs = solve(eqnarray,c) producing: cs ...

7 years ago | 0

| accepted

Answered
Peak "coordinates of a histogram
Not at all certain what question you are asking. If you want to know the indices of the data assigned to each bin, see the hist...

7 years ago | 0

| accepted

Answered
Polar plot draw line at -3dB opening
From your description, this seems to work: angl = 0:10:360; pow = [-18.2 -18.5 -19.7 -21 -22.3 -23 -24.1 -28.1 -33 -37.8 -...

7 years ago | 0

| accepted

Answered
Getting x value for a given y value from a fitted model
I am not certain that the curve fit is at all relevant to your finding a ‘T’ for a specific ‘z’. Try this: c=3*10^8; % spee...

7 years ago | 0

| accepted

Answered
Evaluating integrals multiple input functions and a matrix of data
If you have a speific problem, we can likely provide much more specific solutions. For the time being, see the documentation ...

7 years ago | 2

| accepted

Answered
Array multiplication in matlab
One option: V1 = rand(26000,1); % Create Data V2 = rand(29000,1); ...

7 years ago | 1

Answered
How to Plot Multivariate Differential Equation in MATLAB?
The symbolic approach: syms I R V(t) t V0 I = sym(50E-9); R = sym(200E+6); C = sym(50E-12); Eq = V == I*R - R*C*diff(V);...

7 years ago | 0

| accepted

Answered
I need help to choose the initial parameter to fit this model to my data
This is a linear problem, so no initial parameter estimates are necessary. Just use linear least squares: B = [hd.^2, 1./(hd....

7 years ago | 0

Answered
How can I rewrite this code without cutting the data up into arrays?
The filtfilt function operates on arrays, and will operate on the first dimension greater than 1, as I mentioned in How to filte...

7 years ago | 1

Answered
extract and split data from cell into multiple cells.
One approach: C = {'07.03.2019 20:30' 'a' '07.03.2019 20:31' 'b' '07.03.2019 20:32' 'c' '07.03.2019 20:33' '...

7 years ago | 0

| accepted

Answered
How to filter data of every coloumn in a dataset
If you are using the filtfilt function (as I would certainly recommend), it will filter all the columns at the same time. (If y...

7 years ago | 1

Answered
Contour plot size according to axis ratio
One option would be to use: axis equal This will result in using the same spatial units on all axes. There are also other ...

7 years ago | 0

Answered
I am having trouble with the max and min functions. I am just starting Matlab
Most likely, you have named a variable either ‘max’ or ‘min’ somewhere in your workspace. That’s likely the problem, since the ...

7 years ago | 0

Load more