Answered
Trying to store data
fores(i,:)= "fores" has three dimension, thus fores(i,i,:) ? I don't know where you want to save what and if the dimensions fit...

4 years ago | 0

Answered
How would you make these for loops dynamically recursive?
Code available under https://de.mathworks.com/matlabcentral/fileexchange/7147-permn It's brute-force - thus caution: quite mem...

4 years ago | 0

Answered
Fitting a data with the best fit
Try "fit" with fitType gaussEqn = 'a*exp(-((x-b)/c)^2)+d' https://de.mathworks.com/help/curvefit/fit.html#d124e31956

4 years ago | 0

Answered
Different results using curve fitting app
Scale your problem: x = [262088, 323208, 390728, 464648, 544968, 631688]; y = [0.629, 0.64, 0.93, 0.972, 1.355, 1.56]; xscale...

4 years ago | 1

Answered
Obtain imaginary numbers in for loop but running code at each step on its own produces absolute numbers
diff = (1-(3.*((1-x(i)).^(2/3)))+(2.*(1-x(i)))) reac = (1-((1-x(i)).^(1/3))) instead of diff = (1-(3.*((1-x).^(2/3)))+(2.*(1-...

4 years ago | 0

Answered
Matlab plot not showing correct values
v(i)=0.1553567*(i.^6)-2.0416*(i.^5)+9.1837*(i.^4)-14.829*(i.^3)-1.3703*(i.^2)+32.821*(i)-1.3155 instead of v=0.1553567*(i.^6)-...

4 years ago | 0

Answered
how to plot a periodic function fro negative to positive?
T = pi; % period x = -10:0.1:10; % lets say your original function is y=2*x which repeated every T second, then y = 2*(mod(x-...

4 years ago | 1

| accepted

Answered
Not enough input arguments for my ode15s solver
options = odeset('Mass',E); E is not defined. x0 = [0; x0b ; 0]; x0b is not defined. [tout,xout] = ode15s(prime,tspan,x0,opt...

4 years ago | 0

Answered
How can I build a objective function for a three phase induction motor?
Fobjt = sum((I1-I1est)./I1).^2+((eff-effest)./N1).^2+((fp-fpest)./fp).^2+((I0-I0est)./I0).^2,'All')

4 years ago | 0

| accepted

Answered
How to creat a loop to repeat the code with +1 to the input until the condition is met?
N=1728; sumcands = 0; while sumcands ~=4 N = N+1; b= [1:N^(1/3)]; c = nthroot(N-b.^(3),3); digits=10; ...

4 years ago | 0

| accepted

Answered
Combining elements from two arrays
A = [0.9572 0.1419 0.7922 0.4854 0.4218 0.9595 0.8003 0.9157 0.6557]; B = [0.8147 0.6324 0.95...

4 years ago | 0

| accepted

Answered
How to add "erf()" part to the ode solution?
syms x y(x) eqn = diff(y,x) - (-x+2+10*exp(-10*(x-1)^2)) == 0; cond = y(0)==1; sol = dsolve(eqn,cond) fplot(sol,[0 6])

4 years ago | 1

| accepted

Answered
How can I select specific rows from a matrix when those row numbers are identified by another matrix?
If the row numbers in Matrix2 are already sorted: Matrix3 = Matrix1(Matrix2,:) Else sort them first.

4 years ago | 0

| accepted

Answered
How to plot a math function with a vector
Then maybe T_j_scalar_t = @(t) integral(@(tau) P(tau) .* dZ_th(t - tau), 0, t); T_j = arrayfun(@(t)T_j_scalar_t(t), cooling_ti...

4 years ago | 1

| accepted

Answered
How to fit a smooth curve on discrete data.
Maybe something like this: x = [3, 2.5, 2, 1.5, 1, 0.5]; y = [1.8, 1.75, 1.71, 1.55, 0.8, 1.25]; plot(x,y) xx = linspace(x(1...

4 years ago | 0

| accepted

Answered
Using ODE Event locations: how to implement more than one event with different following solver decisions?
sol.ie as return parameter from the solver indicates which of the events you defined became active. According to this value, the...

4 years ago | 0

| accepted

Answered
How can I solve a Lagrange equation?
syms x1 x2 x3 lambda g = x1+x2+x3 - 10; L = 12*x1-x1^2+8*x2-x2^2+18*x3-3*x3^2+lambda*g; Lx1 = diff(L,x1); Lx2 = diff(L,x2); ...

4 years ago | 0

| accepted

Answered
How to plot function f(x,y,z)=c ?
c = pi/2; f = @(x,y,z) cos(x) + cos(y) + cos(z) - c fimplicit3(f,[-pi pi -pi pi -pi pi])

4 years ago | 1

Answered
Curve fit but only for the values that exists with defined values of x.
load census I = cdate >= 1850 & cdate <= 1950; cdate1 = cdate(I); pop1 = pop(I); plot(cdate,pop,'o') %Create a fit option...

4 years ago | 0

| accepted

Answered
How to find the timestep in ode45?
p(t) represents injection into the body at a rate of 2mg/min. So p(t) depends on the difference between the current and previo...

4 years ago | 0

Answered
error in fminbnd and in my live function
Don't you have to include the circular area G = pi*r^2 at the bottom ? Then add pi*r^2 to A as indicated below. V = 10; % c...

4 years ago | 0

Answered
Solving a PDE symbolically
First check whether (dH/dx1,dH/dx2) is conservative. Then you can reconstruct H by using H(x1,x2) = H(x10,x20) + integral_{z=x...

4 years ago | 0

| accepted

Answered
Not sure how to go farther with this problem.
n = 8; TD = zeros(n); for row = 2 : n-1 TD(row,(row-1):(row+1)) = (row-1):(row+1); end TD You will have to add the set...

4 years ago | 1

Answered
how to plot the gradient of a equation having specific region?
x = -2:0.1:2; y = x; [X,Y] = meshgrid(x,y); f = @(x,y) -15*x.^2+4*y; surf(X,Y,f(X,Y))

4 years ago | 0

Answered
Differential equation not working
I = @(t)100*sin(2*pi*t);; dIdt = @(t) 2*pi*100*cos(2*pi*t); V0 = 0.1; fun = @(t,V,I,dIdt) V/I(t)*dIdt(t)-V/0.01*(V*I(t)/250-1...

4 years ago | 0

Answered
what is the problem of my code doing inverse Poisson cumulative distribution?
lambda = 10; u = 0.6; m = iPoisson(lambda,u) m1 = icdf('Poisson',u,lambda) function m = iPoisson(lambda,u) if u == 1 ...

4 years ago | 0

| accepted

Answered
2D Finite Difference Method
K_11 = (f1(a(1,i)+h,a(2,i))- f1(a(1,i)-h,a(2,i)))/(2*h); K_22 = (f2(a(1,i),a(2,i)+h)- f2(a(1,i),a(2,i)-h))/(2*h); K_12 = (f1(a...

4 years ago | 0

| accepted

Answered
programming and plot equarion
z = -5:0.01:5; f = 2*z/sqrt(pi).*hypergeom(0.5,1.5,-z.^2); plot(z,f)

4 years ago | 0

| accepted

Answered
please guide me how to make plot from –pi to pi.
k = 6 + 6; size = 30 + 9; t = linspace(-pi,pi,1000); X = size * cos (k*t) .* cos(t); Y = size * cos (k*t)...

4 years ago | 1

| accepted

Answered
How do fix this code to give me the error?
Cp = @(T) .00000000747989.*T.^3-.000028903.*T.^2+.0423484.*T+36.1064; H = @(T) 1/4*.00000000747989.*T.^4-1/3*.000028903.*T.^3+1...

4 years ago | 0

Load more