Answered
finding equation of motion using lagranges function
syms th thd g m l k L = m*l^2*thd^2/2 + m*g*l*cos(th); X = {th thd}; Q_i = {0}; Q_e = {0}; R = k*thd^2/2; par = {g m ...

3 years ago | 0

Answered
How to model 3 Degrees of Freedom at once
Define a solution vector y = (y1,y2,y3,y4,y5,y6) with y1 = y_a, y2 = y_a_dot, y3 = z_a, y4 = z_a_dot, y5 = Theta_a, y6 = Theta...

3 years ago | 0

Answered
I want to plot selected data from rows and columns
Plotting the second against the first column does not make much sense because the first column is the year and the second column...

3 years ago | 0

Answered
Python 3.11 Compatibility with MATLAB
https://de.mathworks.com/support/requirements/python-compatibility.html

3 years ago | 1

Answered
I need help integrating this function
The first argument to "integral" has to be a function or a function handle. Both does not seem to be the case in the call Q_tot...

3 years ago | 0

| accepted

Answered
How can i apply a value to a symbol given a solution to a system of equations.
syms h C3 C4 C5 eqn1 = h == C3 + C4 + C5; eqn2 = 0 == 3*C3 + 4*C4 + 5*C5; eqn3 = 0 == 6*C3 + 12*C4 + 20*C5; [C3 C4 C5] = s...

3 years ago | 0

| accepted

Answered
solve a linear system of equations with several unknown parameters
You have 8 equations for 6 unknowns. The consequence in general is that there is no solution that satisfies the 8 equations exac...

3 years ago | 1

Answered
what is wrong with this code?
Most probably, you will have to change all / and * and ^ to ./ and .* and .^ in your code (elementwise operations instead of mat...

3 years ago | 0

Answered
Integral of a Matrix Issue
Why do you name the same radius R in the denominator R_T ? Both are equal to the cylinder radius (in your case 15, I guess). r=...

3 years ago | 0

| accepted

Answered
How do I solve this set of equations using MATLAB?
As you can see from the below analysis, there is only the solution n_1 = n_2 = n_3 = 0 without conditions on the angles th1, th2...

3 years ago | 0

Answered
Including changing variable in ODE
If you want to make alpha dependent on Ts, either use a function handle alpha = @(t,Ts) something or make two vectors of Ts an...

3 years ago | 0

Answered
How do I solve this set of equations using MATLAB?
You want to solve for one unknown - thus you only need one of the two equations. If you want to solve for n1, n2 and n3, you ha...

3 years ago | 0

Answered
what is mean by this?
p1 is a vector. Thus with the expression SNR_N1(i) = h1*sqrt(p1)/sigma(i) you try to assign a vector (right-hand side) to a ...

3 years ago | 0

| accepted

Answered
Matlab alternatives for gradient optimisation problems?
If it fits your needs: this code would run under Octave. %pkg load symbolic syms x1 x2 f = (x1-1)^2+(x2-x1^2)^2; H = hessian...

3 years ago | 1

| accepted

Answered
how derive a solution of ode45
The red curve is the derivative of the blue curve. syms y(t) [V] = odeToVectorField(diff(y, 2) + 2*diff(y) - sin(y) == 0) M =...

3 years ago | 1

| accepted

Answered
Using Newton's method for 2 equations for finding concentration at different points
Why don't you use "fsolve" ? Don't you have a license for the optimization toolbox ? I don't understand J, f1 and f2 in your co...

3 years ago | 0

| accepted

Answered
Ode15s and function containing system of odes
I suggest you start with a simpler example at the beginning than your complicated system of 3 transient PDEs 2D in space. Someth...

3 years ago | 0

| accepted

Answered
How to do partial derivates?
syms x y f = x*sin(x*y); dxy = diff(diff(f,x),y) dyx = diff(diff(f,y),x) By the way: it's called "partial derivatives", not ...

3 years ago | 0

Answered
Unable to plot 3D graph
Doesn't look very impressive, does it ? A = readmatrix("https://de.mathworks.com/matlabcentral/answers/uploaded_files/1184273/2...

3 years ago | 0

| accepted

Answered
pyrun!How do I keep more decimals?
You keep all decimals in both cases - only the output format is different. format long pyrun("x1=0.24236152","x1")

3 years ago | 1

Answered
How to add a constant value above a matrix in following code?
P = [0.25*ones(20,106);P;0.21*ones(20,106)]

3 years ago | 0

| accepted

Answered
Convert Array of symbolic expression to array of symbolic function handle
You mean syms x f = [x^2;x^3]; f1 = matlabFunction(f(1)) f2 = matlabFunction(f(2))

3 years ago | 0

Answered
Numerical differential equation solver for initial conditions not at y0
The solution seems to be very sensitive to the initial condition. syms Uf(t) delta y d = 0.2000; k_Karman = 0.4; sol_Um = 3....

3 years ago | 0

| accepted

Answered
error using inlineval, error unexpected MATLAB expression
syms x f = log(3*x+1) g = diff(f,x)

3 years ago | 1

Answered
Why this code doesn't work?
ti=0.0; tf=15.0; ui=30.0; m=2585; g=10; W=m*g; Theta=0.0; Fx=-2000; f=0.03; rho=1.225; Cd=0.2; A=2.9; uw=0.0; tol=1.0E-4; tra...

3 years ago | 1

| accepted

Answered
Triple integers (cylindrical method)
lower_z = @(r,theta) 0.5*r.^2.*sin(theta).*cos(theta); upper_z = @(r,theta) r.*sqrt(cos(theta).^2+2*sin(theta).^2); fun = @(r,...

3 years ago | 1

| accepted

Answered
Errors with fmincon in Matlab script
[x,fval] = fmincon(@(x)system2(x(1),x(2)),[2;3.5],[],[],[],[],[1;2],[3;5]) instead of [x,fval] = fmincon(system2,[2;3.5],[],[]...

3 years ago | 1

| accepted

Answered
implementation of the bisection method
%fixed inputs c=25.8972; b=0.0320; a=0.7535; R=0.0821; Vc=0.1951; % Generate 30 artificial (Pstar,T) pairs to test Pstar_...

3 years ago | 2

| accepted

Answered
diffuclt to write the su of a number
s0 = 0.5; s = 0; for i=1:1000 s=s+s0; end disp('the sum is: '),s disp('compare with:'),1000*s0

3 years ago | 1

Answered
Array indices must be positive integers or logical values.
f is interpreted here as an array, and arrays can only be indexed with positive integers or logical values. So f(-6) is forbidd...

3 years ago | 0

| accepted

Load more