Answered
The most efficient way to locate the first 1's in each row of a matrix
The max function will return the indices of the first instances of the maximum value it encounters, in the desired dimension. S...

7 years ago | 1

Answered
Ploting problems with handle, maybe I have changes in this function.
Although I usually suggest that images of code are inappropriate, that might be a way to figure out what is wrong with this line...

7 years ago | 0

Answered
Need help implementing a 2D circular gaussian
If you want to plot a surface, you need to use matrix arguments. Try this: x = linspace(-3, 3); y = x; [X,Y] = ndgrid(x,y...

7 years ago | 1

| accepted

Answered
exp(A) gives zero in the first argument
Try this: format longE exp([71 307]) producing: ans = 6.837671229762744e+30 2.130129192828224e+133 See the docu...

7 years ago | 0

| accepted

Answered
how to plot a continuous signal
This should get you started: u = @(t) t>=0; x = @(t,u) cos(200*pi*t.*u(t)); t = linspace(-1, 1); figure(1) plot(t, x(t,u))...

7 years ago | 0

| accepted

Answered
How to change the color of a plane
How would you define ‘Z0’ as a matrix the size of ‘X’ (or ‘‘Y’) that is uniformly zero? (We only give hints to homework probl...

7 years ago | 1

Answered
how to find slope for certain area in graph.
To limit ‘angle’ (and ‘force’) to calculate the slope only on the ‘angle’ limits between 2 and 14, try this: Lv = (angle >= 2)...

7 years ago | 0

| accepted

Answered
Problem with function legend
Setting: opengl software appears to work for this problem. Also consider: Use Software OpenGL for Future Sessions. See th...

7 years ago | 0

Answered
how to eliminate undesidered lines
Use the sort or sortrows function to sort your data by the independent variable values.

7 years ago | 0

Answered
Problem with my code?
I do not see that you defined ‘Qfresh’ anywhere in your function.

7 years ago | 0

Answered
How can I plot a filled cylinder with a specific height?
You can use the cylinder function, however writing your own code is more fun: x = [1 3]; y = [2 5]; r=1; hgt = [2 3]; th=0...

7 years ago | 4

| accepted

Answered
Curve fitting by Genetic Algorithm
I can fit part of your data, however not all of it, because there is some noise in elements 19 through 24 that your function is ...

7 years ago | 1

| accepted

Answered
lsqcurvefit fitting not good
Choose different values for ‘x0’. I used these: x0 = [-2.6; 17; 0.7; 7; 0.0001; -0.7; 0.7]; to get this result: x = -...

7 years ago | 1

| accepted

Answered
The @ symbol in Matlab
The ‘@’ denotes a function handle. See: What Is a Function Handle? for an extended discussion. In this instance, ‘f’ is ...

7 years ago | 3

| accepted

Answered
How can I plot a X where my dataset crosses the X axis (y=0), but only when dy/dx > 0?
To detect the zero-crossings, the code in Easy way of finding zero crossing of a function , and you can interpolate to get the e...

7 years ago | 0

Answered
Matrix dimensions must agree.
Note that you used element-wise division some times when you divided by ‘(2*L)’ but not other times: ue = 1-2.*cos((3.*pi.*x)....

7 years ago | 0

Answered
Find intersection of 2 normal distribution
The ‘val’ value is the x-value of the intersection, however you need to start fzero in the correct region for it to return the c...

7 years ago | 2

| accepted

Answered
solving similtanous equations in loop
One approach: x = [1,2,3,4,5,6,7]; y = [1,2,3,4,5,6,7]; [X,Y] = meshgrid(x,y); xv = X(:); yv = Y(:); % -3*w*sin(x)+ 5*q...

7 years ago | 0

Answered
Low Pass filter not working
Your stopband attenuation is likely not sufficient to produce any difference. Try this instead: Rs = 60; ...

7 years ago | 0

| accepted

Answered
Plotting bacterial growth using odes
I believe Monod kinetics and curve fitting can help. You are not fitting data, so just use the ODE and ode45 call syntax. ...

7 years ago | 0

| accepted

Answered
What is the best non-linear least square fitting method that will parameter error in addition to parameters?
If you have the Statistics and Machine Learning Toolbox, see if the fitnlm function will do what you want. Other options are nl...

7 years ago | 0

| accepted

Answered
How does Matlab divide two row vectors by each other to get a scalar?
To expand slightly on that, ‘C’ is the least-squares estimate of the slope of with the y-intercept forced through the origin: ...

7 years ago | 2

| accepted

Answered
How can I get the equation of CDF curve in matlab figure?
The cdfplot function plots an empirical distribution based on the characteristics of your data. You can see if it corresponds t...

7 years ago | 0

Answered
Bandwidth analysis of a system with multidimensional input
The length of the input vector is likely irrelevant, and is not even an argument to the bandwidth function. Note however that t...

7 years ago | 1

| accepted

Answered
Get t co-ordinate based off y co-ordinate
Try these: t = 0 * pi:0.119:4 * pi; a = 57; phase_angle = 0.26; y = a*sin((67*pi*t) + phase_angle); y_ofst = y-40; zci ...

7 years ago | 0

Answered
Unique ID Min and Max with multiple values per Unique ID
One approach: M = [10 10 17 17 17 201 1000; 0.1 69 1.7 33 55 67 0.99].'; [UM1, ia,ic] = unique(M(:,1), 'stable'); Vmx = acc...

7 years ago | 0

Answered
List Variables through loop
I am not certain what you want to do. In any event, this is likely more efficient: idx = sort(randi(9, 1, 10)); sla = diff...

7 years ago | 0

Answered
Split .wav file into equal time segments
Use the Signal Processing Toolbox buffer function.

7 years ago | 0

| accepted

Answered
how can I solve non polynomial equations.
FIRST: see Getting Started. What you posted is not valid MATLAB code. There may be many solutions, depending on the initia...

7 years ago | 0

| accepted

Answered
Error using plot Data must be numeric, datetime, duration or an array convertible to double. Error in prueba3 (line 12) plot(x,Vol);
I have no idea what you want ‘x’ to be. Try this: figure fplot(Vol, [0 C]); Make appropriate changes to define ‘x’ (defin...

7 years ago | 1

| accepted

Load more