Answered
Solving constrained differential equations
Solving the above system is only possible in the form M = [1 0 0 0 0; ... 0 m1 0 0 0; ... 0 0 1 0 0; ... 0 0 ...

4 years ago | 0

| accepted

Answered
Please how do I get rid of local variables may have been changed to match the globals error?
Can you take it from here for your case ? f = @(x,a) x.^2 + a.^2; x = -2:0.01:2; a = 0:0.1:1; array = zeros(numel(a),numel(x...

4 years ago | 0

| accepted

Answered
How do I add "internal" upper and lower bounds to the function lsqcurvefit?
The condition lambda_1 <= lambda_2 has to be set in A,b of the mimimizer "fmincon". "lsqcurvefit" is not suited in this case.

4 years ago | 0

| accepted

Answered
What is the pdf of Jakes' Model
You mean the equation of the pdf in the histogram ? theta = rand(1000000,1); v_max = 1.0; v = v_max*cos(theta); histogram(v,...

4 years ago | 0

Answered
lsqcurvefit with custom equation
The saturation concentration for your model is 9.35e-4. So you will never reach 5.6e-3 as in your data. Note that the infinite ...

4 years ago | 0

Answered
how to plot this equation
syms x y k f = y^3 + k^2*y^2 + k*y + 3; s = solve(f==0,y,'Maxdegree',3); s1 = sqrt(s); s2 = -sqrt(s); k = 0:0.1:10; s11 = ...

4 years ago | 0

Answered
How to convert this equation to a matlab code?
It's written as it stands: a = 0.5*[1-zeta.^2,2-zeta.^2,1-alpha,2-alpha,1-beta,2-beta]; b = [1]; c = 0.5*[0,1]; d = 0.5*[-ze...

4 years ago | 1

| accepted

Answered
Solving a system of equations symbolically
Better ? syms F0 R1 R2 d1 d2 d12 thta thta12 m1 m2 assume(thta12,'real') assume(thta, 'real') assume(thta~=0) eq1=((F0/R1...

4 years ago | 0

| accepted

Answered
Unable to integrate a function using integral and vpaintegral
syms x theta = 6.3*pi/180; f = (1+cosh(2*theta*x))/sinh(2*pi*x)*tanh((pi-theta)*x); vpaintegral(f,x,0,Inf)

4 years ago | 0

| accepted

Answered
Changing for loop to backslash
A = [6 -1 0 0 0; -3 3 0 0 0; 0 -1 9 0 0; 0 -1 -8 11 -2; -3 -1 0 0 4]; b = [10:10:100;repmat([0; 160; 0; 0],1,10)]; dA = decomp...

4 years ago | 0

| accepted

Answered
Fitting a hyperbola through a set of points
Remove the NaN value in the last position of data.P2 and data.I2: clear all; data=readtable("https://de.mathworks.com/matlabce...

4 years ago | 1

| accepted

Answered
How to segregate data according to its temperature value?
Use MATLAB's "discretize" for the temperature array and use the so received vector Y of bins to split the vector of water levels...

4 years ago | 0

Answered
Options for solving a system of non-linear equations
"fsolve" is the only MATLAB tool to be used for this purpose.

4 years ago | 0

| accepted

Answered
How can I calculate the moments of an exponential random variable
syms mu x lower upper n assume(n,'integer') assume(n>0) lower = 0; upper = 5; mu = 3; f = 1/mu*exp(-x/mu) / int(1/mu*exp(-...

4 years ago | 0

Answered
Data plot for different values
%store your outputs for each xi thetaxivalues(ixi,:,:) = theta(:,:); vxivalues(ixi,:,:) = v(:,:); What is ixi ? I guess, it's...

4 years ago | 0

| accepted

Answered
How to interchange position of a matrix?
Are you sure that the changes should be performed subsequently with the new vectors obtained from the steps before ? My guess ...

4 years ago | 1

Answered
why error occurring in the program, i already define the z1 correctly i think?
Where do you define z1(1),z2(1),z3(1),z4(1),z5(1), x1(1),x2(1),x3(1),x4(1),x5(1), o1(1),o2(1),o3(1),o4(1),o5(1) needed to st...

4 years ago | 0

Answered
How to find unknown y values from known x values on a graph with no clear line equation?
y_whole_number = interp1(x_experimental,y_experimental,(0:100))

4 years ago | 0

| accepted

Answered
how can i get a slope in the loglog plot?
ID = ...; dID = gradient(log10((1:600).'),log10(ID)); loglog(ID) hold on plot(log10((1:600).'),dID)

4 years ago | 0

| accepted

Answered
For loop for Covariance of two vectors
The covariance between two given vectors is a scalar, namely cov(x,y) = 1/(n-1) * sum_{i=1}^{i=n} (x(i)-mean(x))*(y(i)-mean(y))...

4 years ago | 0

Answered
How to calculate rate constant if population vs time table data is given?
I assume N is given after 1 second each and starts at t=0 with N(0) = 1. t = 1:9; N = [2 3 4.5 7 10 16 29 56 104]; fun = @(p,...

4 years ago | 0

Answered
Index exceeds the number of array elements. Index must not exceed 1.
In the expression CAn(i)=inct*((CA0-CA(i-1))/tresid-k*CA(i-1))+CA(i-1); , you reference CA as an array, but only CA(1) is defi...

4 years ago | 0

Answered
Find index of a number in a 3d array
i = find(A(:) == 31.5814); [i1 i2 i3] = ind2sub([14610,146,220],i(1)); A(i1,i2,i3) But most probably, floating point inaccura...

4 years ago | 0

| accepted

Answered
How to plot a function for different values of input parameter in a function
Just define xi as a column vector of values, e.g. xi = [0.03 0.06].'; % activity parameter

4 years ago | 0

Answered
Solve implicit equation for isentropic flow
gamma = 1.4; [mach,T,P,rho,area] = flowisentropic(gamma,4,'sup') Aratio = 4.0; gamma = 1.4; fcn = @(M) (1/M)*(2/(gamma+1)*(1...

4 years ago | 0

Answered
How to fit my experimental data with using matlab code
integrand = @(r) sech((rm-r)/gama).* ... (1./(1-exp(-2*pi*sqrt(Eb./(r-Eg))))).* ... (1./(1-b*(r-Eg))); K = A*(1/rm)*(...

4 years ago | 0

| accepted

Answered
MATLAB CODE FOR ROOT MEAN SQUARED
This is not the standard definition for the root-mean-square value of a matrix. Are you sure about the formula ? Then use cal...

4 years ago | 0

| accepted

Answered
Internal heat source as a function of x,y and time in pde toolbox
Thank you for your answer. So i can’t define the function f with piecewise as i did? It’s wrong? Yes, it's wrong because it is ...

4 years ago | 0

Answered
stiff ode solver with non-negative properties
Do the negative solutions result from numerical inaccuracies or from the equations themselves ? If the latter is the case, no r...

4 years ago | 0

Load more