Answered
how do i print my conversion code?
cube = @(n)prod((1:n)/n); n = 1:1000; series_terms = arrayfun(cube,n); series_values = cumsum(array); series_values = series...

4 years ago | 0

Answered
how do i fix this code? (finding convergence of divergence)
cube = @(n)prod((1:n)/n);

4 years ago | 0

| accepted

Answered
Stuck at coding modified Newton-Rapson function
Why do you call it "Modified Newton-Raphson" ? I do not quite understand what the two lines mul=subs(func,xr)/subs(diff(func)...

4 years ago | 0

| accepted

Answered
Array multiplication returning single value
Specs ~ n x 7 A1Temp ~ 1 x 7 A2Temp ~ 7 x n A3Temp ~ 1 x n AResult ~ 1 x 1

4 years ago | 0

Answered
Nonscalar arrays of function handles are not allowed; use cell arrays instead.
syms o p fun1 = o+p; fun2 = o*p+5; fun = [fun1,fun2]; eq = matlabFunction(fun); bbb = fsolve(@(x)eq(x(1),x(2)),[0,1]);

4 years ago | 0

Answered
Shifting Bivariate Distribution to a New Center
mu = [2 2]; instead of mu = [0 0];

4 years ago | 0

| accepted

Answered
errors in lsqnonlin fittings for models of different components
The code you supplied is not the code which caused the error message. The error message is caused by a line F(1:lx)=real(Fcmpx...

4 years ago | 0

Answered
a function that has two inputs: a number and a row vector
scalar = 6.0; vector = [3 5 8]; output = input(scalar,vector) function output = input(scalar,vector) output = scalar*vec...

4 years ago | 0

Answered
divide each column of an array by its norm of the column
A = A./vecnorm(A,2)

4 years ago | 1

| accepted

Answered
how to write this code ?
What is the code supposed to do with the three V-values ? You can write syms V_ab V_bc V_ca eqn = V_ab + V_bc + V_ca == 0 re...

4 years ago | 0

Answered
obvious error in differentiation
Did you try pretty(h1) and/or isequal(h1,h2) ( I named the second term h2 ) ? I think they are equal - at least in h1 you c...

4 years ago | 0

| accepted

Answered
How to take integral of an equation?
Your code is chaotic, so I don't know exactly what you are trying to do. Make the best of this: R=0.56225; R0 = 0.1; delta_R...

4 years ago | 0

| accepted

Answered
Can't get Newton Rapshon implicit Euler method to work
g should be g =@(z) z-z1-h*f(t0+h,z) with Jacobian jg = eye(2)-h*jf

4 years ago | 1

| accepted

Answered
Why is my plot blank?
data = readtable('clcd.xlsx'); Alpha =(data{:,1}); % Angle of Attack (deg.) CL = (data{:,2}); % Lift Coefficient CD = (data{:...

4 years ago | 0

Answered
Empty Sym 0-by-1
If you print out "du", you will see that it has no zero (the numerator does not depend on u): du = (sym) ...

4 years ago | 0

Answered
Trouble using a for loop and using indexes properly - why am I getting "Index exceeds the number of array elements (1)" as an error?
Is it this what you want ? e = 100:100:100000; for i = 1:numel(e) E = e(i); epsilon = 0.03255/(Z1*Z2*((Z1^2/3)+(Z2^2...

4 years ago | 0

| accepted

Answered
Editing a function and then using fzero
%variables u0 = 4*pi*10e-7; Ms = 0.8; gamma = 1; Ku=1; D = 0; A = 1; sinfei = sin(-pi/2); delta=1; syms d W for m = 1:...

4 years ago | 0

| accepted

Answered
how can I solve this non linear partial differential equation mentioned below I have some initial & boundary condition
Discretize the differential operators, include the boundary conditions and solve the resulting system of nonlinear equations for...

4 years ago | 0

Answered
Solving Constrained Optimization for 4 variables (or 3?)
It's a simple linear optimization problem. If you are allowed to, use "linprog" to solve. f = [1; 1; 1; 0]; Aeq = [3 1 0 -1;1 ...

4 years ago | 1

Answered
Solving a set of simultaneous equations
a = 0.5; fun =@(x1,x2,x3,x4) [x1^2 + a*x1*x2 + a*x1*x3 + a*x1*x4 - 30^2;... a*x2*x1 + x2^2 + a*x2*x3 + a*...

4 years ago | 1

| accepted

Answered
How to customize a complex differentiated equation?
The term is 0 if r^2+e3*G*H**x^4e2-f^3*b = 0. Can you solve for x ?

4 years ago | 0

Answered
Numerical Integration on Matlab
I2 = integral(@(xint) ((xint*I1_c*I2_c)/2.*xint),xi_0,xi_1); J2_c = (1-epsilon*tan(phi))*(cos(phi))^2; J2 = integral(@(xint) ...

4 years ago | 0

Answered
Exprnd function same randomness after a loop
https://de.mathworks.com/matlabcentral/answers/269639-what-does-command-rng-default-do

4 years ago | 0

| accepted

Answered
how to do series summation of complex triple integral?
I suggest Er = 4; E0 = 8.85418782e-12; %F/m b = 5e-3; %mm --> m a = 2e-3; %mm --> m d = 150e-6; %um --> m %% Capacitance ...

4 years ago | 1

Answered
Saving FOR loop values to an array
T = 0:resolution:BurnTime; nt = numel(T); for i = 1:nt t = T(i); BurnRate = (-(MFuel)/BurnTime); CurrentMass = ...

4 years ago | 0

Answered
How to use syms in multiple variable?
This code does not throw an error, but I don't know whether it will succeed to find an antiderivative for your expressions. sym...

4 years ago | 0

Answered
How to remove "root(f(z), z, n)" from solve solution?
syms f B r L k c g t S u v h m w J a n p V D A mu q m1 m2 m3 eq1 = (f*B + r*L - k*L - c*L - m1*A*L) eq2 = (g*B + t*S - u*S - v...

4 years ago | 0

Answered
linear least regression solving a and b from given data
b = a0/a1 instead of b = a0

4 years ago | 0

| accepted

Answered
I have simultaneous nonlinear multi inequality problem with constraints and parameters.
What do you expect as output from the solve command ? You can multiply the last inequality by beta and it cancels out. So beta...

4 years ago | 0

Load more