Answered
How can I update my symbolic expression?
c2_sol = solve(subs(def1,x,0)==0,c2) And for every expression where you want to substitute c2 by c2_sol: subs(expression,c2,c2...

2 years ago | 0

Answered
Complex solutions in ODE solver
x^12.94 can give complex values for the derivatives if x < 0.

2 years ago | 1

Answered
Determination of distribution parameters from quantile values
fit1_Werte = 0.713666092353130; fit2_Werte = 0.535608240510766; fun = @(x,y)[gaminv(0.01,x,y) - fit2_Werte;gaminv(0.5,x,y) - f...

2 years ago | 0

| accepted

Answered
Implementing Finite Difference Scheme
Approximate the derivatives in r, not in rc. Use formula (3.2 c) from the attached document (with c = 1 in your case) for r = ...

2 years ago | 0

Answered
How best and most efficient way to build this matrix
Experiment with "spdiags": https://uk.mathworks.com/help/matlab/ref/spdiags.html If first and last row appear different from y...

2 years ago | 0

Answered
Electroadsorption PDE with langmuir Isoterm
Try pde1dm https://uk.mathworks.com/matlabcentral/fileexchange/97437-pde1dm?tab=reviews or else use the method-of-lines approa...

2 years ago | 1

| accepted

Answered
Error in Variables Regression
Linear Total Least Squares Regression means minimizing the sum of distances of projections of your data on a linear subspace. Th...

2 years ago | 0

| accepted

Answered
Find a variable from an integration equation
ct=@(speed,motor_power)base_speed1./(motor_power-(a+b.*speed.^2).*base_speed); %Function 1% cp=@(speed,motor_power)speed./(moto...

2 years ago | 1

| accepted

Answered
Error on Symbolic calculation : "Empty sym : 0-by-1"
Try this code. By the way: numel(v1(i,j)), numel(v2(i,j)) and numel(v3(i,j)) always equals 1 because v1(i,j), v2(i,j) and v3(i,...

2 years ago | 1

| accepted

Answered
symbolic function give error list of equations must not be empty
syms Shy Por_den = 0.4:0.1:0.8; W= 1.2; rho_ma = 2.75; rho_water = 1.03; rho_hydrate = 0.90; Measure_VEL=1.4:0.1:1.8; vw= 1.49...

2 years ago | 0

Answered
Need help in using trapz to integrate a definite function
Maybe you mean clear all c=3*10^8; % speed of light in vaccum h=6.626*10.^-34; % Planck constant k=1.38*10.^-23; % Boltz...

2 years ago | 0

Answered
Problem in solving equation with Gamma distribution parameters as unknowns
I'd try it numerically. Better initial values for y,z and la might give convergence. fun = @(y,z,la)[gaminv(0.95,y,z)-gaminv(0....

2 years ago | 0

| accepted

Answered
How to fit a histogram plot to a poisson distribution
Simply use lambdahat = poissfit(spacing_ratios) But I'm surprised you want to fit data that take non-integer values with a dis...

2 years ago | 0

Answered
why the plot of C is a constant through the time (differential equation résolution)
You start with an initial value y02 = 0. The rate of change of Y2 is z2 = 4.*(0.1.*exp(-5000./(8.314.*300))).*y, thus 0 since ...

2 years ago | 1

Answered
I want to know which of the two spaces each point belongs to in a 3-dimensional space divided into two parts by a single plane.
The two half-spaces that IR^3 is divided in by the plane are a(x-p)+b(y-q)+c(z-r) < 0 and a(x-p)+b(y-q)+c(z-r) > 0. So for a gi...

2 years ago | 4

| accepted

Answered
Solve closed loop system equation with disturbance input via function handle
By using interp1 to interpolate the column value to the time instant of the ODE integrator. Or use your own integrator with a f...

2 years ago | 1

Answered
How do i store the output from my for loop for each iteration
You must return "store", not "sol" to the program calling the function "tosolve".

2 years ago | 0

Answered
Find nth value in a matrix and plot on graph
Run = 6; i72=zeros([max(Run) 1]); i68=i72; i62=i72; i58=i72; i22=i72; i18=i72; i12=i72; i08=i72; for i = 1:Run if i==1 ...

2 years ago | 0

Answered
In an assignment A(:) = B, the number of elements in A and B must be the same. How can I fix this error?
For Run = 1, you get empty results for i72(1),i68(1),.... But i71(1),i68(1),... cannot be removed from the 2x1 arrays i71, i68,....

2 years ago | 1

| accepted

Answered
how to index the stating position of something?
x1 = [1 0 2 3 8 5 6 7 0 0 0 0 0 2 5 3 0 0 6 4]; out1 = LengthAndPosnZeros(x1) x2 = [1 0 0 8 5 0 0 3 3 3 3 0 0 0 0]; out2 = ...

2 years ago | 0

Answered
I have an error in my program. the error is about 'Error using letter_detection (line 4) Not enough input arguments.' using Matlab R2015A and I named the file letter_detection
You should test the procedure with a simple example: Write a function function s = addition(a,b) s = a+b; end and save it...

2 years ago | 0

Answered
I do not understand exit message given by lsqnonlin,
Should be function [c,ceq] = myNonlinearConstraints(x) V_sim= evalin('base','V_sim'); Vsim_max = max(V_sim); c(1) = x(...

2 years ago | 2

Answered
solution of a system of PDEs with finite difference method and runge kutta second order
Where is the x in your equations ? I only see differentiation with respect to t. And shouldn't the 2nd order differentiation in ...

2 years ago | 0

| accepted

Answered
I don't know how to include specific conditions in my code
a = [0 0 9 0; 0 0 1 8; 0 0 4 0; 0 0 2 3; 0 6 7 5]; z = lastzerorow(a) function z = lastzerorow(a) ...

2 years ago | 0

| accepted

Answered
Finite difference method for a system of pde
These kind of transformations are usually made to transform a system of PDEs to a system of ODEs that can be solved more easily....

2 years ago | 0

Answered
How to solve PDE with second order in the time derivative in Matlab?
You could try du/dt = v (1+t^2)*dv/dt +t*v = (1+x^2)*d^2u/dx^2 + x*du/dx du/dx = dv/dx = 0 at x = 0 % dv/dx = 0 is artifici...

2 years ago | 1

| accepted

Answered
I'm trying to do harmonic analysis, but it says that the t_get18consts function is not defined.
From https://www.eoas.ubc.ca/~rich/ (2019) I've modified v1.3b by running it through the matlab editor and fixing a lot o...

2 years ago | 0

| accepted

Answered
Solving linear systems in Matlab
x = A\(u-A*b) But it's the same as x = A\u - b

2 years ago | 0

| accepted

Answered
Efficient searching to find the first element of an array meeting a condition
"find" will use the "first" option by default which means that the command will return the first occurence of the event and will...

2 years ago | 0

Answered
Plot multiple graph after solving
syms y t g f1 = -2*g*t.^3/((1 - y).^(1-2*g)) + 2*g*(3 - t.^2)^2./((2 - t).*y.^(1-2*g)) + (8*g*t)./(y.^(1-2*g)) - 2*g*(3 - 2*t)....

2 years ago | 1

| accepted

Load more