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

Answered
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
The usual way to define a function is function [output1,output2,...] = name_of_the_function(input1,iput2,...) Your line of...

3 years ago | 0

Answered
Divided difference in Newton's form error
Whatever your code is supposed to do, add a sixth element to the vector "a" in function "dd": a = [-5, 2, -4, 8, 3, 6]; instea...

3 years ago | 0

Answered
sorting vector by value and position
A = [109 97 116 108 97 98]; [~,p] = sort(A,'ascend'); r = 1:length(A); r(p) = r

3 years ago | 1

| accepted

Answered
Optimoptions - Invalid solver specified error
You wrote 'StepToleance' instead of 'StepTolerance' ...

3 years ago | 0

Answered
Find x and y cordinates and t for z=0
xvel=20; yvel=20; zvel=40; g=-9.80665; t = [0:0.1:10]; xacc = 0; yacc = 0; zacc = g; sx = xvel*t + (0.5 * xacc*t.^2); s...

3 years ago | 0

Answered
Error using plot Vectors must be the same length.
Replace mf = [mf1 mf2 mf3]; by mf = [mf1; mf2; mf3];

3 years ago | 0

Load more