lsqcurvefit to estimate parameters in ODE45
Modifications in the following lines are necessary: [ ... ] = lsqcurvefit(@(theta,t) kinetics(theta,t,precision),...) function...

6 meses ago | 0

How to create a function handle for thermodynamics(semi-infinite heat conduction) using erfc with multiple variables?
Use ./ instead of / in your definition of thetafh. But you are asked to write a function, not a function handle.

6 meses ago | 0

| accepted

How to separate real and imaginary value into different column?
A = [real(v),imag(v)]; if v is the column vector with 1024 complex numbers.

6 meses ago | 0

| accepted

How to code erf(z) summation series?
function main z = [0.1 0.5 1 2]; for i=1:numel(z) [erfc1(i),n(i)] = myerfc1(z(i)); end erfc_matlab = erfc(z); X = [z.',...

6 meses ago | 0

| accepted

How can I solve this partial differentiation equation numerically?
A = zeros(M+1); U2 = zeros(M+1,N+1); A(1,1) = 1; for i=2:M A(i,i-1) = -sigma; A(i,i) = 1+2*sigma; A(i,i+1) = -sigma;...

6 meses ago | 0

| accepted

(Solved) Help with please these are hard
function [n,summa] = threshold(limit) summa = 0; n = 0; while summa <= limit n = n+1; summa = summa + 5*n^2 - 2*n; end...

6 meses ago | 0

| accepted

Derivative of a function of three variables
syms y S K C(y,S,K) =exp(-y*sqrt(S*K)); g = gradient(C(y,S,K),[y,S,K])

6 meses ago | 1

| accepted

Integrate a random function
Matlab tools can not be used for this problem because the integral is not simply a numerical value, but a random variable itself...

6 meses ago | 0

| accepted

Solve partial differential equations coupled
There is no matlab code that can solve this problem directly. Look at the CLAWPACK package available in the internet.

6 meses ago | 1

| accepted

summing columns based on certain interval
sum(sum(A(1:51,:))) sum(sum(A(53:102,:))) sum(sum(A(104:153,:)))

6 meses ago | 0

How to draw graph of the following function?
function main a = 1; nu = 2; d0 = 0; nu0 = 1; n = 15; deltat = 0.05; % end of user inputs T = 0:deltat:n ; M = [(1-a/nu...

6 meses ago | 1

| accepted

How to predict furure values in a non linear regression?
Naive procedure: If your fitting curve depends on time t, evaluate it at the future time instant you have in mind. But be very...

6 meses ago | 0

How to create Matrix of known dimensions with random values?
For random numbers uniformly distributed on [0,1] : A = rand(5,3);

6 meses ago | 0

Calculate perpendicular line to an 3rd order polynomial
For a general function f, the formula for the perpendicular line to the function through (x0,f(x0)) is y = f(x0) + (x-x0)* ( -1...

6 meses ago | 0

| accepted

PDEPE coupled boundary condition help
dX^bar/dt = 3/R * D_ap * dX/dr (@r=R) For dX/dr (@r=R) you can insert the right-hand side of your second boundary condition for...

6 meses ago | 0

| accepted

Plotting General Solution Of Differential Equation
Maybe sol = dsolve(eq); sols = subs(sol,[C1,C2,C3,C4],[-1,-1,-1,-1]); fplot(sols,[-10,10])

6 meses ago | 0

How to quickly find the indecies of elements in an array?
indices = find(A==B)

6 meses ago | 0

how to arrange x-coordinate w.r.t y-coordinates?
Something like As = sortrows(A); x = As(y(:)+1,1) where y is the vector of y-coordinates ?

6 meses ago | 0

| accepted

how to solve this nonlinear equation?
function main p=0.1:0.5:10; gss0 = 1.0; for i=1:numel(p) gss(i)= fzero(@(x)fun(x,p(i)),gss0) gss0 = gss(i); end plo...

7 meses ago | 0

| accepted

ode15s and 0de23 very slow at high frequencies
I have no experience with the physical background, but if for low frequencies, the solution somehow looks like sin(0.001*x) and ...

7 meses ago | 1

| accepted

Sum of elements of a matrix such that no row or column repeats
p = randperm(n); sum = 0.0; for k = 1:n sum = sum + a(k,p(k)); end where a is the nxn matrix.

7 meses ago | 0

| accepted

Index in position 3 exceeds array bounds (must not exceed 1).
You overwrite C when you call contourf.

7 meses ago | 0

| accepted

Integrating the results of state space output(ode45)
Alternatively to the solution I suggested previously, you can use Matlab's "cumtrapz".

7 meses ago | 0

potting the integral of a state
If y'(t)=f(t,y) is the state space equation, you get the integral of y by simultaneously solving z'(t)=y(t), z(0)=0.

7 meses ago | 0

How do I write an inductive sequence?
N = 10; % define number of recurrence terms to be calculated x = zeros(N,1); x(1)...

más de 1 año ago | 1

| accepted

substract array elements based on other arrays
setdiff(All,union(R1,R2))

más de 1 año ago | 1

| accepted

Solving large sparse Ax=b with lower bound constraint
Did you try starting from the solution of the unconstraint problem ?

más de 1 año ago | 0

| accepted

dsolve second order differential equation
dySol=diff(ySol,x); dySol(585.8)

más de 1 año ago | 0

| accepted