Answered
Wrong,all the time(Equation(6) is y(i,6), not dy(6))
Instead of your for-loop, use t0=[0 25 50 70 80 100 180]; x=[0 5 7 9 10 11 14]; k = 3; p=polyfit(t0,x,k); X...

11 years ago | 0

| accepted

Answered
How to write function in matlab
A starting point : https://en.wikipedia.org/wiki/Bilinear_interpolation Best wishes Torsten.

11 years ago | 0

Answered
How to integrate equation in Matlab? is it necessary to put values for each variable?
Take a look at the examples under http://de.mathworks.com/help/symbolic/int.html They should answer your questions. Bes...

11 years ago | 0

| accepted

Answered
Question about fminunc function (iteration problem)
Yes, fminunc does not work with symbolic variables. Best wishes Torsten.

11 years ago | 0

| accepted

Answered
please i have a question in matlab can any one help me please i want to correct this code ? i dont understand the error
e(u) is the u-the element of the vector e, thus a single number. In the command e(u)= rand (1,100); you try to assign a v...

11 years ago | 0

Answered
how to write a code for a variant of Newton's method in calculating square root of a matrix?
A = [1 5;2 3]; I=eye(2); x0= A+I; for k = 0:10 x1=(1/2)*(x0+(inv(x0)*(A+(I/(k+1))))); x0 = x1; end Be...

11 years ago | 0

| accepted

Answered
How to write dynamic equations in state-space form?
y1'=y2 y2'=(f_engine-f_brake-(C_d*y2^2+mu*m*g))/m Here y1=x, y2=dx/dt. Best wishes Torsten.

11 years ago | 0

| accepted

Answered
Performing a convolution of two exponential functions in Matlab
http://www.wolframalpha.com/input/?i=convolution+of+two+functions&f1=a*exp(-x%2Fb)%2B1&f=ConvolveCalculator.convolvefunction1_a*...

11 years ago | 0

Answered
I have been asked to Stimulate V-S plot of enzyme activity from the equation :- dS/dt =-Vm*S/(Km+S),
Use function main n=1; Ki=0.1; Vs=5; [T,Y]=ode45(@(t,y)react(t,y,n,Ki,Vs),[0 15],[0.2]); DY(:,1)=-Vs*Y(:,1...

11 years ago | 0

| accepted

Answered
Trust-region-dogleg algorithm of FSOLVE cannot handle non-square systems; using Levenberg-Marquardt algorithm instead.
function res = Switch(h,lambda,row, mu, mu_one, a, b, c, r, gamma, A, sigma_one, beta1,delta1) OP = h(1); EC = h(2); OC...

11 years ago | 0

| accepted

Answered
I have been asked to Stimulate V-S plot of enzyme activity from the equation :- dS/dt =-Vm*S/(Km+S),
n=1; Ki=0.1; Vs=5; [T,Y]=ode45(@(t,y)react(t,y,n,Ki,Vs),[0 15],[0.2]); DY(:,1)=-Vs*Y(:,1).^n./(Ki^n + Y(:,1).^n)...

11 years ago | 0

Answered
How to stop ode after 50th event has occurred
Not each call to y0eventPoincare means that a new event has occured. Thus it is not possible to keep track of the number of even...

11 years ago | 0

| accepted

Answered
Using fsolve with an interval of values
Use F(1,1)=... and F(2,1)=... instead of F{1}=... and F{2}=... Furthermore, it's not clear to me which variable you want to v...

11 years ago | 0

Answered
2 degree equation with 2 variables
Since you use diff(diff(...)), I suspect you want to solve differential equations, not algebraic equations. If this is the ca...

11 years ago | 0

| accepted

Answered
How do I integrate an erfc (complementary error function)?
Q(i)=1/pi*vpa(int(f,0,f0Tao(i)),5); But I guess the integration will be difficult because you divide by sin(x)^3 which is zer...

11 years ago | 0

| accepted

Answered
PDE propagating from point source
I assume you want the point source appear at r=0. Choose the interval of integration as [0:R] where R is big enough to ensure...

11 years ago | 0

| accepted

Answered
Run fmincon with different initial value
for j=1:n x0=[x10(j);x20(j)]; [x,fval,exitflag] = fmincon(obj,x0,[],[],[],[],[10;100],[500;100000],nonlinfcn...

11 years ago | 1

| accepted

Answered
How can I get numerical output from 'fit' and 'int' functions?
If the fitting function is "fun", apply fzero as x_value = fzero(@(x)integral(fun,xmin,x)-y_value,[xmin xmax]) Best wish...

11 years ago | 1

Answered
Solve a 1D Heat Conduction equation using pdepe
As far as I know, pdepe does not accept periodic boundary conditions. Maybe http://www.mathworks.com/matlabcentral/fileex...

11 years ago | 2

Answered
Solving second order symbolic ODE
You tried to use one of the ODE solvers, e.g. ODE45 ? Best wishes Torsten.

11 years ago | 0

Answered
ode45- must return a column vector (Thanks in advance for help)
The function must look like function dMdx=s(x,M,gamma_b,a1Vec,b1Vec,xVec) a1=interp1(xVec,a1Vec,x); b1=interp1(xVec,b...

11 years ago | 0

| accepted

Answered
How to Nonlinear Equation?
help fsolve Best wishes Torsten.

11 years ago | 0

| accepted

Answered
ODE45 with a parameter which changes in every time step
1. E1, E2 and Y0 are undefined. 2. Your call to ODE45 must look somehow like [Tp,Y]=ode45(@(Tp,Y)diff(Tp,Y,K(i)),Tp_span,Y...

11 years ago | 2

| accepted

Answered
Constraint condition and IF statement
function [c,ceq]=bb12(x) a=(((0.025*(x(1)^2)*(1-exp((-1.025*x(3))/x(1))))/(((x(2)^2)/(x(1)+x(2)))*(1-exp((-0.513*x(3)*(x(1)...

11 years ago | 0

| accepted

Answered
Linprog optimisation with slack variable. How do I formulate the matices?
l_1-norm: The problem can be formulated as min: sum_i s_i |a*x(i)+b-y(i)| <= s_i or equivalently min: sum...

11 years ago | 0

Answered
Problem solving a system of differential equations
uspan=0:0.1:1; K=3; g=0.1; dydu=@(u,y)[(-2*u*y(1)-K*(y(1)*u-(1+g)))/(1+u^2+K*u*(u-(1+g)/y(1))) (1-u^2)...

11 years ago | 1

| accepted

Answered
Matrix X.^23 without approximation
Apply Titus' answer under http://www.mathworks.com/matlabcentral/answers/227104-25-23-without-approximation to each elemen...

11 years ago | 1

Load more