Answered
Could you help me how Can I solve this integral?
Use "vpaintegral" instead of "int": syms x expr(x) = sin(x)/x*exp(-3*x^2+i*x); I = vpaintegral(expr,-10,10) or directly sy...

4 years ago | 1

| accepted

Answered
Poiseuille flow in Elliptical channel
r = linspace(0,1,20); phi= linspace(0,2*pi,36); [R,PHI] = meshgrid(r,phi); X=a*R.*cos(PHI); Y=b*R.*sin(PHI); V = -1/(2*mu)*...

5 years ago | 1

| accepted

Answered
How to change my spline code to natural spline?
One google search and so many hits, e.g. http://de.mathworks.com/matlabcentral/answers/387177-plot-natural-cubic-spline#answer_...

5 years ago | 0

Answered
How to Add Matrix as x0 Variable in fminsearch?
for i=1:number_of_estimates value_of_objective(i) = objective_function(X0(:,i)) end where X0 is the matrix in which the c...

5 years ago | 0

Answered
Elementwise division in matrix notation
Backslash \ , not divide /.

5 years ago | 0

| accepted

Answered
Help regarding solving equations
Change sin(a) to sind(a). Further Qi will never be exactly Qd. I suggest you print Qi-Qd over a and see if it intersects the a...

5 years ago | 0

| accepted

Answered
Need to use ode45 to solve a problem
This is a delay differential equation. You will have to use DDE23 instead of ode45.

5 years ago | 3

Answered
How to Compute All Combinations of Vectors of Length 6 Made up of Numbers -1 and 1?
Brute force would be unique(perms(A)) Maybe there is a better solution.

5 years ago | 0

| accepted

Answered
Look Up Table for position solver
Use fmincon (or maybe better ga, since the objective function doesn't look differentiable) to solve the following problem: min:...

5 years ago | 1

| accepted

Answered
Solving equation without syms
For the first equation: Build the polynomial of degree 3 in V with pencil and paper, give numerical values to S,V0,C and P and ...

5 years ago | 1

| accepted

Answered
Determining the steady-state concentrations using your numerical solutions.
Set dadt,dbdt,dcdt and dddt to 0 and solve the algebraic system in a,b,c,d using fsolve, e.g.

5 years ago | 0

Answered
Make a 3D plot over a circle
r=linspace(75,365,25); phi=linspace(0,2*pi,36); [R,PHI]=meshgrid(r,phi); X=R.*cos(PHI); Y=R.*sin(PHI); Z=interp1(rm,velm,sq...

5 years ago | 1

Answered
Replace powers with a sequence
syms x c = sym2poly(expand((x-1)^3)); e = sym('e',[3,1]); c_times_e = c*e

5 years ago | 0

Answered
computing a interpolating polynomial for some function
x = linspace(-1,1,20); yfunc = @(x) 1./(1+16*x.^2); y = yfunc(x); ... or x=linspace(-1,1,20); y=1./(1+16*x.^2); ...

5 years ago | 0

| accepted

Answered
how to find the reversal matrix
B = (v.'\i.').'

5 years ago | 1

Answered
Doubt about finding the nearest values between array and a matrix
for i=1:size(Array,2) [r{i},c{i}] = find(abs(Matrix-Array(i))==min(abs(Matrix(:)-Array(i)))); end

5 years ago | 1

| accepted

Answered
Finding the last value of a difference equation
Then iterate 2-times more starting with n=1 instead of n=-1. function res = my_matlab_function(A,N) y = zeros(N+1,1) y(1)...

5 years ago | 0

Answered
Optimization with time-dependent constraint
Use "linprog" and define the 24 equalities SOC_i - (SOC_i-1 + c_i - d_i) = 0 (i=1,...24) in the matrix Aeq with SOC_1,...,SO...

5 years ago | 0

Answered
Why does 40-variable optimization array exceed maximum array size preference?
It's hard to see what MATLAB does when using the problem-based approach. I prefer the solver-based approach because it is much ...

5 years ago | 0

| accepted

Answered
Solving system of four second order ODEs
4 second-order ODEs need 8 initial conditions, not 4.

5 years ago | 1

| accepted

Answered
5x5 matrix (P) with all 25 values unknown. I have two known matrices of size 5x5 each (A1 and A2) and the relation P*A1*inv(P)=A2. How do I obtain P?
I think you could also get such P by solving the linear optimization problem min: sum_ij (eij+ + eij-) under the constraints ...

5 years ago | 0

Answered
eig return complex values
Use E = eig(A,C) instead of E = eig(inv(C)*A) or E = eig(C\A)

5 years ago | 0

| accepted

Answered
Minimize norm of the complex number array with subtraction of a variable
for ii = 1:N rng default rdc0 = 1+1i; % You add one complex value to try to minimize the resulting sum of squares ...

5 years ago | 0

| accepted

Answered
How to solve NaN when using trapz?
[num data raw] = xlsread('Flowratevel.xlsx'); for i=1:size(num,2) Num{i} = num(:,i)(~isnan(num(:,i))); end A1 = pi*Num{1...

5 years ago | 0

| accepted

Answered
How to solve 3 TDOA equations with 3 variables x,y,z
Code for symbolic solution: syms x y z x1 = 0.60; y1 = 0.00; z1 = 0.70; x2 = 0.20; y2 = 1.30; z2 = 0.70; x3 = 0.80; y3 = 1....

5 years ago | 0

| accepted

Answered
How to solve 3 TDOA equations with 3 variables x,y,z
If there are no specialized methods to solve the TDOA equations (did you take a look into the literature ?), I suggest trying s...

5 years ago | 0

Answered
how to solve system of 2 differential equation with boundaries
Rewrite your equations as a system of first-order ODEs dy(1) = y(2); dy(2) = 9*phi_A^2*y(1)/(1+y(1)+y(2)); dy(3) = y(4); dy(...

5 years ago | 0

| accepted

Answered
Need help with homework (simple backwards interpolation)
Specify the extrapolation value in interp2.

5 years ago | 0

Answered
Empty Sym when using vpasolve-operator.
e = [0.05:0.05:1]; syms tp for i=1:numel(e) eqn = 900-e(i)*5.67*10^(-8)*tp^4-20*(tp-293)==0; S{i} = vpasolve(eqn,tp); e...

5 years ago | 0

Answered
How to solve for unknown function in integral equation?
One (maybe naive) approach: Choose 0=n(1)<n(2)< ... <n(K)< oo and z(1),...,z(K) Then use linsolve to solve the linear sy...

5 years ago | 0

Load more