Answered
Calculate the next 2 numbers in the sequence
u_(n+2) = 4*u_(n+1) + 2*u_n If you insert n = 0, you get u_2 = 4*u_1 + 2*u_0 So what is u_2 given that u_0 = 3 and u_1 = 2 ? ...

3 years ago | 0

| accepted

Answered
Trying to find the Euclidean distance of 2 vectors with different sizes
T =[5.1000 3.5000 6.4000 3.2000 5.4000 3.4000 5.7000 2.8000 5.7000 4.4000 5.6...

3 years ago | 0

Answered
Function for ODE45 requires all coefficients be written in it
tspan = linspace(0,35,35000); f0 = [1; 1; 1; 1; 1; 1; 1; 1]; a = 2; g_p = 3; g_s = 105; g_a = 0; g = 1; k = 250; P = 0; O_z = ...

3 years ago | 1

Answered
Making a horizontal region between two functions
f = @(x) x.^3; g = @(x) x.^(1/3); a = 0; b = 1; hold on fplot(f,[a,b]) n = 20; for i = 1:n+1 start = [g((i-1)/n*b),1];...

3 years ago | 0

Answered
Set initial condition to time different to 0
This is a boundary value problem, not an initial value problem. Thus you should use bvp4c instead of ode45.

3 years ago | 0

Answered
Finding the minimizer using fminunc.
fv = @(x) x(1)^2 + x(1)*x(2) + (3/2)*x(2)^2 - 2*log(x(1)) - log(x(2)); [minimizer,minimum_value] = fminunc(fv,[1; 1])

3 years ago | 0

| accepted

Answered
Testing if Data is close to the Exponential Distribution
How can I take this data and see if it is exponentially distributed? There is no way to do so. Also, how can I find how far t...

3 years ago | 1

| accepted

Answered
Nonlinear equations with two variables and a changing parameter
%The below is a system of nonlinear equations with two variables x, t, and %a changing parameter V. 0<x<0.2, t is around 6.3e6,...

3 years ago | 0

| accepted

Answered
Solving a system of equations using the solve function in a for loop?
Remove all the (t) in the symbolic variables, so use syms q TPCM Toil_PCM_to_EG instead of syms q(t) TPCM(t) Toil_PCM_to_EG(...

3 years ago | 1

Answered
How to fit parameters of an ode by using ode45 and fmincon
Check your differential equations. As you can see, the derivatives for the given constellation (parameters and initial condition...

3 years ago | 1

| accepted

Answered
Solve Command giving wrong numbers for certain values, but gives perfect answers for the rest?
As you can see, there are two solutions for angle_3 and angle_4. Seems you took the wrong one for 290-330 degrees. syms angle_2...

3 years ago | 0

Answered
3 state space model time discretization
x_dot = A*x + [B,C]*[u;v] So define A_ss = A, B_ss = [B,C]

3 years ago | 0

Answered
Steady-state solution for system of parabolic PDEs?
Since this gives a system of second-order ODEs in general, the usual code to try would be "bvp4c".

3 years ago | 0

| accepted

Answered
Fitting curve of curve with parametric representation to measured data
opt = fmincon(@(S)Fehlerberechnung_Kreisevolvente(S(1),S(2),S(3),S(4)), [2,0,0,0]) instead of opt = fmincon(@(S)Fehlerberechnu...

3 years ago | 0

| accepted

Answered
When coding of function that shows error in yellow underline.
If f is a function handle, this line of your code doesn't make sense: if fc > f Only the result of function handles applie...

3 years ago | 0

Answered
Getting A blank Graph
I changed y3 to what I think you meant. x=0:0.01:1; y1=(0.5*x.^5)-(0.6*x.^4)-(0.6*x.^3)+(0.3*x.^2)+0.25; y2=(sin(x).*cos(x))...

3 years ago | 1

| accepted

Answered
after runing this function, i only see the result of t{1}.. in the command window but not in the workplace so i can't use this value , does anyone know why?
Output T to the calling program - then it will appear in the workspace: D=[0 0 0 pi/2; 0 5 0 pi/6; 0 5 0 pi/2]; T = ...

3 years ago | 0

| accepted

Answered
Integration of elements of a matrix
syms x x1 x2 x3 x4 x5 x6 F3w F4w F5w F3p F4p F5p assume([x x1 x2 x3 x4 x5 x6 F3w F4w F5w F3p F4p F5p],'real') L2=60000; L1=4...

3 years ago | 0

Answered
Solving Heat equation using pdepe does not give credible results
m=1; xmesh=linspace(0,270E-6,270); tspan=linspace(0,2,50); sol=pdepe(m,@pdefun,@icfun,@bcfun,xmesh,tspan); u=sol(:,:,1); fi...

3 years ago | 0

| accepted

Answered
Points inside the sphere
Hint: Use the function fun = @(x,y,z) ((x-X)/a).^2 + ((y-Y)/b).^2 + ((z-Z)/c).^2 - 1.0;

3 years ago | 1

Answered
solving a system of equations
M1=3 P1=101325 %pa or 1 atm theta2 = .349 %rad or 20 degrees theta3 =.262 %rad or 15 degrees %first get P2 and P3 %area 2 ...

3 years ago | 0

Answered
How can I plot two functions in the same graph?
fplot(@cosh) hold on p = @(x)0.6671*x.^3-1.7921*x.^2+2.7580*x-0.089; fplot(p) hold off

3 years ago | 0

| accepted

Answered
Iterating an equation through a range of values to satisfy a condition
count = 0; for X = 11:15 % Needs to be a range of values from 11 to 15 count = count + 1; X_array(count) = X; ...

3 years ago | 0

Answered
Question on DDE23
lags=1; tspan=[0 10]; sol = dde23(@ddefunc,lags,[0.8; 0.2],tspan); plot(sol.x,sol.y(1,:)) function yp = ddefunc(~,y,Z) ...

3 years ago | 1

| accepted

Answered
solving 1D parabolic-elliptic equations with one initial condition
Supply an arbitrary initial condition for the elliptic pde - if possible one that satisfies its boundary conditions. If pdepe a...

3 years ago | 0

Answered
How to solve multiple equation and get all value of the variable?
p1 can be chosen arbitrarily since the corresponding column in the matrix A is zero. (I set p1 = 1). Note that sol does not sa...

3 years ago | 0

| accepted

Answered
How can i plot this function? y=0.75/(log10(x)*2).^2
What do you mean by "in 2D" ? It is a simple function to be plotted y vs. x: x = 2:0.01:5; y = 0.75./(log10(x)*2).^2; plot(x,...

3 years ago | 0

Answered
Mean distance function upgrade question
Don't know if you have enough RAM for this. Note that the distance matrix pdist2(group1,group2) will be 70000 x 80000 in your ca...

3 years ago | 1

Answered
How would I use the 'count' function but to only count instances of both columns being specified?
x_y_= [1 4; 5 3;9 8; 2 7;1 8;7 2; 2 7;1 5;4 3]; n = nnz(ismember(x_y_,[2,7],'rows'))

3 years ago | 0

Load more