Answered
I need to make a Gaussian fit, problem is i dont know how to type the parameters using lsqcurvefit
M = [ 24.6 1.518572825 24.7 1.5083088954 24.8 1.5210166178 24.9 1.4203323558 24...

4 years ago | 1

| accepted

Answered
Index in position 1 exceeds array bounds.
Seems that with the command if k == numfilesperday data(1:4,:) = []; end you have destroyed the complete matrix "data"....

4 years ago | 1

Answered
Matrix inside for loop not updating
hold on for t =1:1:200 g1(t)=3*cos(2*pi*450*t-141); plot(t,g1(t),'.') drawnow end

4 years ago | 0

| accepted

Answered
Failing in creating a surface from three array
To create a surface, you need a z value for each combination of (x/y) values. Thus instead of a vector z with 6 elements you nee...

4 years ago | 1

Answered
Please explain how to solve coupled equation in MATLAB? ODE 45 or Runge kutta method? The equation is d/dz(Ep) + (n/c) d/dt (Ep) = Es M where n= 1.45 and C = 3e8
The equation you posted is a PDE, not an ODE. So an ODE integrator cannot be used directly for its solution. You will have to d...

4 years ago | 0

Answered
Intersection of two parametric circles in R3
Minimize(t1,t2) norm(v1(t1)-v2(t2))^2 Use an optimizer to determine t1 and t2, e.g. fminsearch.

4 years ago | 0

Answered
Using a fucntion in loop
P = [1 -2 4] a = 0; n = 3; while(a < n) P = polyder(P) a = a + 1; end

4 years ago | 0

| accepted

Answered
increasing amplitude of sine wave
y=t/StopTime.*sin(2*pi*Fc*t); instead of y = A*sin(2*pi*Fc*t);

4 years ago | 0

Answered
Fit custom equation with two datasets
help lsqcurvefit

4 years ago | 0

| accepted

Answered
Contour plot of a function
H = 0:0.01:3; XI = 0:0.01:2; for i=1:numel(H) h = H(i); for j=1:numel(XI) xi = XI(j); for k=1:m q = x +...

4 years ago | 0

Answered
Where is the wrong in this code??
f_b(1/z) = (0.1000 - 0.3000i)z^-1 + (0.2121 - 0.0008i)z^-2 + (0.9000 +0.0010i)z^-3 I wrote it several times already, but this f...

4 years ago | 0

| accepted

Answered
Bisection Method Code Help
I didn't check whether there is a programming error in bisection1. In comparison to fzero it's very inexact - that's for sure. ...

4 years ago | 0

Answered
While loop setting error calculation is not calculating properly.
betaIter_deg (and thus betaIter) need to be reset because they are incremented in the while-loop.

4 years ago | 1

Answered
can I generate random no. from 0 to 10E5, but the condition is ?
numbers = sort(100e3*rand(1,80),'ascend') or numbers(1) = 100e3*rand; for i = 2:80 numbers(i) = numbers(i-1) + (100e3 - ...

4 years ago | 0

Answered
Index exceeds the number of array elements. Index must not exceed 2.
dr = (r1 - r2)/Ang; implies r1 > r2 r = r1:dr:r2; implies r2 > r1 So what is correct ?

4 years ago | 0

Answered
How to calculate the center of the obtained Area in this case?
https://en.wikipedia.org/wiki/Centroid#Of_a_polygon https://de.mathworks.com/help/matlab/ref/polyshape.centroid.html

4 years ago | 0

Answered
How to find the index of the values which are bigger than zero the following case?
M = [ 0 0.5 0.7]; [~,indices] = find(M>0)

4 years ago | 0

Answered
"A matrix 'B' of 5x5 whose elements are all 5"
B = 5*ones(5)

4 years ago | 1

Answered
anonymous, piecewise-defined function that has NaN as response for a certain subdomain
g=@(x) (x) .* (x<=-1)+... (x+1) .* (x>-1 & x<1)+... (-x+4) .* (x>=1); x = [-2,0,1.5,2.5,5]; gx = g(x); gx(x>2 & x<=...

4 years ago | 0

Answered
For loop alternative method
SensorA_under_30_degrees = SensorA(Temperature<30)

4 years ago | 1

| accepted

Answered
Symbolic Integration Problem Using Symbolic Math Toolbox
syms par1 par2 par3 par4 par5 syms a q p s b mR nR r syms y yA yU K5 = cos(par1*y+par2)*sin(par3*y+par4)*cos(par5*y); K55 ...

4 years ago | 0

| accepted

Answered
4 graph in 1 figure
Choose what you need: https://de.mathworks.com/help/matlab/creating_plots/graph-with-multiple-x-axes-and-y-axes.html https://d...

4 years ago | 0

Answered
How can I specify a parameter to solve a system of equations symbolically?
syms v_0 t_1 v_1 p_1 eqns_1 = [ ... t_1 == 2.0, ... v_1 == v_0, ... p_1 == v_0 * t_1, ... ]; solve(eqns_1,...

4 years ago | 0

| accepted

Answered
Deterministic SEIR ODE model running slow
%Define model parameters as a structure (N.B. stick to days here for ease %later on) A = [10 0.1; 0.1 1]; J = 13000000+530000...

4 years ago | 0

| accepted

Answered
How to write an if-else statement for a function
n = 6; f = 2; for i = 2:n f = sqrt(1+f); end f finf = 0.5+sqrt(0.5^2+1)

4 years ago | 0

Answered
Which solver can solve this equation for V. Result should be around 59. I tested the to halfs of the equation on python. Thank you for your directions in the first place.
fun = @(V)((500-V)-((650.5/(((150.5-V*0.5)/(V*0.8660254037844386))+1.364))*1.364))/((((((((500*2-(500-V))/3.052050807569)*1.7320...

4 years ago | 0

| accepted

Answered
lsqcurvefit error: requires all values returned by functions to be of data type double
F3 = double(symsum(f,n,[0 Inf])); instead of F3 = symsum(f,n,[0 Inf]); Why do the elements in x0 repeat with very different a...

4 years ago | 1

Answered
How to fit data points to a known implicit function to get the parameters of the function
M = [68.8 110 68.1 178 66.75 241 64.36 297 61.04 343 57.3 380 53.26 407 49.6 430 46 445 ...

4 years ago | 0

| accepted

Answered
Creating a square matrix from 5 vectors
If the R's are row vectors: A = [R1;R2;R3;R4;R5] If they are column vectors: A = [R1,R2,R3,R4,R5]

4 years ago | 0

| accepted

Answered
where is the fault the code is not running as it has two delays with four variables?
sol = exam4() function sol = exam4 options = ddeset('Events',@exam4e); sol = dde23(@exam4f,[1, 10],[5; 0.1; 1; 7],[0, 40],opt...

4 years ago | 0

| accepted

Load more