Answered
solve equation for a variable
You don't need a toolbox for this. Take a piece of paper and a pencil, multiply the equation by the denominator of the left-han...

3 years ago | 0

Answered
How to put value from one matrix into another matrix
help reshape Or are the entries of the matrix B not necessarily as regular as in your picture ? A = [1 2 3 4 5 6 7 8;0.2 0.8 0...

3 years ago | 0

Answered
At every value of x, how measure slope of plot?
Look at the approximate slope curve under https://de.mathworks.com/matlabcentral/answers/1919960-how-can-i-interpolate-x-and-y-...

3 years ago | 0

Answered
How can I interpolate x and y data points in plot and slope (dy/dx) at any value of x?
x=[15 20 25 30 35 40 45 50 55]; y=[11.89 11.845 11.85 11.855 11.865 11.93 12.01 12.2 12.77]; % Approximate dy/dx dy = gradien...

3 years ago | 0

| accepted

Answered
Modeling using 6 differential equation and a constraint?
v = FT*0.082*T/P = sum(dydVol)*0.082*T/P = 1/v*sum(dydVol*v)*0.082*T/P -> v^2 = sum(dydVol*v)*0.082*T/P Thus define the d...

3 years ago | 0

Answered
Index must not exceed 10, but why???
If dt is an array of length 10, then "n" in the loop "for j = 1:n" must be <= 10 since you try to access dt(j). Is this the ca...

3 years ago | 1

| accepted

Answered
How to save a vector from each iteration in a loop in a matrix?
output_all(:,i) = output(1,:).'; instead of output_all(:,i) = output(1,:);

3 years ago | 0

Answered
No solution found. fsolve stopped because the relative size of the current step is less than the value of the step size tolerance squared
q=1.6e-19; kb=1.38e-23; T=300; phit=(kb*T)/q; % Ilgt=20e-3; % Irevsat=1.98e-15; rshunt=1e3; rseries=10; n=1; V_array=-1...

3 years ago | 3

| accepted

Answered
Minimize a function with equality, inequality, and product in constraints
x2,x3,x5 and x7 are all >= 0. Thus the constraint (x5+x2)*(x3+x7) = 0 either gives x5=x2=0 or x3=x7=0. Thus use "linprog" twi...

3 years ago | 1

Answered
how to iterate cell array?
all_N1 = cell(51,1); % Generate 100 matrices of size 20x20 and save them in cell array for i = 1:100 all_N1{i} = rand(20); ...

3 years ago | 0

Answered
Solving an eq. using a large table by vpasolve is to slow
syms A.var1 A.var2 A.var3 A.var4 X Equation = ((A.var1 -c1*X^4)- (c2*A.var2*(6.105.*exp((c3*X)./(X+c4)) -A.var3)) - (c5*(X-A.v...

3 years ago | 0

| accepted

Answered
Solving matrix differential equation
I took R10, R20 as initial conditions for your matrix equations. I formed W1, W2 with the matrices R1 and R2 at time t. You for...

3 years ago | 0

| accepted

Answered
subs() in symbolic chain rule outpus incorrect derivative?
The below looks fine to me. Which MATLAB version do you use ? syms x y(x) f(a,b) Df = diff(f(x,y(x)),x) Df = subs(Df,diff(y(x...

3 years ago | 0

| accepted

Answered
Approximating parameters with ODE, error using vertcat dimesions of arrays being concatenated are not consistent
If you debug your code, you will see that c has dimension 1x12 while theta has dimension 1x11 in the function "fhat". Thus the...

3 years ago | 0

Answered
why do i get an error saying not enough input arguments for this code using bvp4c? it also says there is an error in dYdx(1)=Y(2)
solinit=bvpinit(x,[0;0;0;0;1;0;1;0]); instead of solinit=[0;0;0;0;1;0;1;0]; and sol=bvp4c(@bvp_func,@boundary_conditions,sol...

3 years ago | 1

Answered
Problems using Linear Regression and syntax
For the Antoine equation, you usually work with log10: T = [273.15; 300.00; 310.00; 320.00; 330.00; 340.00; 350.00; ...

3 years ago | 0

Answered
Please, help to find a mistake in the code for double integral
n = 1 ; t = 1; k = 1; %(k is ksi in formula) s = 0:0.5:20; fun = @(x,q,p) ((x.*exp(2*n*t.*(x.^2)))./sqrt(1-x.^2)).*(exp(-2*t...

3 years ago | 0

Answered
MATLAB giving me a 16x1 complex double answer?
Replace syms w h by syms w h real positive

3 years ago | 0

Answered
How do I plot 5e^(0.5t)sin(2*pi*t)
Note that sin(2*pi*t) = 0 for t = 0,1,2,3,...,10. And these are the only points for t you specified.

3 years ago | 1

Answered
How to write as symbolic piecewise function with conditions on a symbolic vector
n = 2; Xi = sym('Xi',[1 n]); ff = piecewise(max(abs(Xi))<=1,sum(Xi.^2),Inf) fsurf(ff)

3 years ago | 1

Answered
Solving matrix differential equation
From the documentation of ode45: y0 — Initial conditions vector Initial conditions, specified as a vector. y0 must be the sam...

3 years ago | 0

Answered
Trapezoidal numerical integration of f(y) = ( 1 / x(y) ) dy
y_p = 1.6; % position where the force is applied y = [0, 0.2, 0.3, 0.5, 0.7, 0.9, 1, 1.2, 1.4, 1.6]; % y coordinates x = [3.5,...

3 years ago | 0

Answered
Fast Element-Wise power to non-integer value
I don't know your optimization problem, but this helps saving function evaluations if objective function and constraints share t...

3 years ago | 0

| accepted

Answered
I need to calculate the infinite summation of this equation for different values of x, using a for loop
L = 1; n = 1:500; lambda = (2*n-1)*pi/(2*L); alpha = 1; t = 0.1; x = (linspace(0,L,100)).'; f = (-1).^(n+1)./(2*n-1).*exp(...

3 years ago | 0

| accepted

Answered
Optimize Center of Circle given noisy data points on arbitrary Plane?
https://de.mathworks.com/matlabcentral/answers/475212-circle-least-squares-fit-for-3d-data

3 years ago | 0

| accepted

Answered
Problem with piecewise Plots
:-) syms f(t) f(t) = piecewise(0<=t<2*pi,2,2*pi<=t<=2*pi+0.001,0); fplot(f,[0 2*pi+0.001],'r*--') xlim([0 7]) ylim([-1 5])

3 years ago | 0

Answered
Need help calculating thrust required curve
You must call TRc with a numerical input vector for v to get a plot. v = linspace(1,20,100); fval = TRc(v); plot(v,fval) fun...

3 years ago | 0

| accepted

Answered
Solve a system of differential equations which has blkdiag
x = [1;2;3;4;5;6]; x = reshape(x,2,[]); B = arrayfun(@(i)squeeze(kron(x(:,i).',eye(2))),1:size(x,2),'UniformOutput',0); C = b...

3 years ago | 1

Answered
how do I solve symbolic eigenvalue?
syms ei l h=l/4; k=(2*ei/h^3)*[6 -3*h -6 -3*h; -3*h 2*h^2 3*h h^2; -6 3*h 6 3*h; -3*h h^2 3*h 2*h^2]; m=(1/(30*h))*[36 -3*h ...

3 years ago | 0

Answered
Unrecognized function or variable 'calculate_energy' and 'move_monomer'. how to solve the issue?
% Define initial energy and energy change when covalent interaction breaks total_energy = -8.75; delta_energy = -0.25; % De...

3 years ago | 0

Load more