Answered
I am seeking help over the code for my numerical integration equation.
syms x y u_inf u = ...; % some function of x f = (1-u/u_inf)*u/u_inf; theta = int(f,x,0,y)

4 years ago | 1

Answered
Below Code is used for solving order 6 ODEs and is showing errors which i am unable to solve . Please Help.. Thanks!
f = @(t,X) [-2*X(1)+2*X(2); %dx1/dt 0.5*X(1)- 2*X(2) + 1.5*X(3); %dx2/dt 0.667*...

4 years ago | 0

Answered
Using Linprog to perform a MaxMin optimization.
min: -v v <= -3*z1 + 2*z2 v <= z1 - z2 + additional constraints

4 years ago | 1

| accepted

Answered
Need help in finding all the solutions of non linear ellipse equations using Newtons Method using following code.
Maybe a symbolic approach is want you want: syms x y res1 = (x+y+2)^2 + (x+3)^2 - 5 == 0; res2 = 2*(x+3)^2 + (y/3)^2 - 4 == 0...

4 years ago | 1

Answered
Dot indexing is not supported for variables of this type. How to fix this?
r5guess.*cos(th5guess) r5guess.*sin(th5guess) instead of r5guess.cos(th5guess) r5guess.sin(th5guess)

4 years ago | 0

| accepted

Answered
Graph Not Plotting for the For Loop Code
H=linspace(0,40000,4001) rho=zeros(1,numel(H)) for i=1:numel(H) h = H(i); if h > 25000 T = -131.21 + h.*0.0...

4 years ago | 1

Answered
how can i wrote a geometric series
help cumsum ZZ_d = cumsum(position_d)

4 years ago | 0

| accepted

Answered
How can I create this Cumulative Normal (Gaussian) Psychometric Function?
pf = normcdf(x,alpha,beta)

4 years ago | 0

| accepted

Answered
Intercept of each line to y-line
a = f1.a; b = f1.b; xintercept1 = 1/b*log(1.5228/a); (Same for f2,f3,f4 and f5)

4 years ago | 0

| accepted

Answered
Error using Plot for Fourier Series
x = 0:0.01:4; N = 10; n = 1:N; for i=1:numel(x) f(i) = 0.5 + 2/pi*sum((-1).^(n-1).*cos((2*n-1)*pi*x(i)/2)./(2*n-1)); end...

4 years ago | 0

Answered
Why am I getting the not enough inputs error on line 63 when defining matrix (f=)?
function [th3,th4,th5,r5] = NR(~,~,th3guess,th4guess,th5guess,r2,r3,r4,r5guess) instead of function [th3,th4,th5,r5] = NR(~,~,...

4 years ago | 0

| accepted

Answered
Need to solve the non linear equation below using Matlab
Na = ...; Nd = ...; NC = ...; EC = ...; kbT = ...; EA = ...; NV = ...; EV = ...; ED = ...; EF = zeros(numel(Na),numel(N...

4 years ago | 0

Answered
for loop does not save the values in the respective array
%________________ %parĂ¡metros % Pc y Tc tomado de https://www.linde-gas.es/es/images/n-Butano_tcm316-612756.pdf % w tomado ...

4 years ago | 0

| accepted

Answered
Plotting an implicit solution obtained by differential equation in MATLAB
The solution to the differential equation with y(0) = 3 is only defined up to the point x where y' becomes Infinity.

4 years ago | 0

Answered
How can I generate codes including the all possible arrangements of 3 digits (0, 1, -1) like this codes
You forgot 0 0 0 :-) Try https://de.mathworks.com/matlabcentral/fileexchange/7147-permn for your problem.

4 years ago | 0

| accepted

Answered
combine 2 matrices to 1 matrix?
N = numel(A); C = zeros(2*N,1); C(1:2:end-1) = A; C(2:2:end) = B;

4 years ago | 1

| accepted

Answered
Alternative to add assumptions to vpasolve
I don't know if your system of equations has a solution, but you can enforce sum(w(i))=1 by replacing wi by wi/(w1+w2+w3+w4) (i...

4 years ago | 0

| accepted

Answered
Mutiply 2 matrix operations at the same time using a function
function [M1 M2] = MatMult(A,B,C) M1 = A*B; M2 = A*C; end

4 years ago | 0

Answered
Greetings to all, could you help me with this integral please
t = linspace(0.1,3,29); x = linspace(-3,3,60); [T,X] = meshgrid(t,x) for i = 1:numel(x) for j = 1:numel(t) f = ...

4 years ago | 1

| accepted

Answered
How do i fit a rotated ellipse to my data in MATLAB
Change your equation to that of a rotated ellipse, e.g. f = @(a) (((x-c(1))*cos(a(3))+(y-c(2))*sin(a(3)))/a(1)).^2 + (((x-c(1))...

4 years ago | 0

Answered
Restrain fsolve and fzero to return only postivie solutions
In fzero or fsolve, square the x vector with which you are asked to evaluate your equation: function res = fun(x) x = x.^2; ...

4 years ago | 0

Answered
for loop only gives me one value
You only set xi(1) in for i=1:nc xi(i)= z1./(1+alpha_g(i).*(ki_1(i)-1)); but refer to xi(1) up to xi(6) in the following...

4 years ago | 1

Answered
How would I create a row vector, knowing the first value, the increment and the number of entries?
frames = 0:0.82:(size(lms,3)-1)*0.82

4 years ago | 2

| accepted

Answered
Peng-Robinson 3 equations of state to find the number of moles
syms Vm F = ((R*T)/(Vm-b))-((a*alpha)/(Vm^2+2*b*Vm-b^2))-p == 0; Vmzero= double(solve(F)); Vmzero = Vmzero(abs(imag(Vmzero))<...

4 years ago | 0

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)*...

4 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_...

4 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...

4 years ago | 0

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

4 years ago | 0

| accepted

Load more