Beantwortet
How to write as symbolic piecewise function with conditions on a symbolic vector
n = 2; Xi = sym('Xi',[1 n]); ff = piecewise(max(abs(Xi))<=1,sum(Xi.^2),Inf) fsurf(ff)

mehr als 3 Jahre vor | 1

Beantwortet
Solving matrix differential equation
From the documentation of ode45: y0 — Initial conditions vector Initial conditions, specified as a vector. y0 must be the sam...

mehr als 3 Jahre vor | 0

Beantwortet
Trapezoidal numerical integration of f(y) = ( 1 / x(y) ) dy
y_p = 1.6; % position where the force is applied y = [0, 0.2, 0.3, 0.5, 0.7, 0.9, 1, 1.2, 1.4, 1.6]; % y coordinates x = [3.5,...

mehr als 3 Jahre vor | 0

Beantwortet
Fast Element-Wise power to non-integer value
I don't know your optimization problem, but this helps saving function evaluations if objective function and constraints share t...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
I need to calculate the infinite summation of this equation for different values of x, using a for loop
L = 1; n = 1:500; lambda = (2*n-1)*pi/(2*L); alpha = 1; t = 0.1; x = (linspace(0,L,100)).'; f = (-1).^(n+1)./(2*n-1).*exp(...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Optimize Center of Circle given noisy data points on arbitrary Plane?
https://de.mathworks.com/matlabcentral/answers/475212-circle-least-squares-fit-for-3d-data

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Problem with piecewise Plots
:-) syms f(t) f(t) = piecewise(0<=t<2*pi,2,2*pi<=t<=2*pi+0.001,0); fplot(f,[0 2*pi+0.001],'r*--') xlim([0 7]) ylim([-1 5])

mehr als 3 Jahre vor | 0

Beantwortet
Need help calculating thrust required curve
You must call TRc with a numerical input vector for v to get a plot. v = linspace(1,20,100); fval = TRc(v); plot(v,fval) fun...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Solve a system of differential equations which has blkdiag
x = [1;2;3;4;5;6]; x = reshape(x,2,[]); B = arrayfun(@(i)squeeze(kron(x(:,i).',eye(2))),1:size(x,2),'UniformOutput',0); C = b...

mehr als 3 Jahre vor | 1

Beantwortet
how do I solve symbolic eigenvalue?
syms ei l h=l/4; k=(2*ei/h^3)*[6 -3*h -6 -3*h; -3*h 2*h^2 3*h h^2; -6 3*h 6 3*h; -3*h h^2 3*h 2*h^2]; m=(1/(30*h))*[36 -3*h ...

mehr als 3 Jahre vor | 0

Beantwortet
Unrecognized function or variable 'calculate_energy' and 'move_monomer'. how to solve the issue?
% Define initial energy and energy change when covalent interaction breaks total_energy = -8.75; delta_energy = -0.25; % De...

mehr als 3 Jahre vor | 0

Beantwortet
optimization problem in matlab
Why using 'FiniteDifferenceStepSize'and'TypicalX'in your options if you don't want to set values for them ? [c1 c2] = minimize_...

mehr als 3 Jahre vor | 0

Beantwortet
lsqcurvefit "assigning the function output to this expression is not supported"
Try F = @(x,xdata) bEll2+hFace2-((xdata.^2)./(bEll2.*(1 + sqrt(1 - (1 + x(1)).*(xdata.^2./bEll2.^2)))) + x(2)*xdata.^4 + x(3)*x...

mehr als 3 Jahre vor | 0

Beantwortet
How do I solve this 1D transient convection-diffusion equation with the convection term coupled with transient boundary values?
MATLAB's "pdepe" doesn't allow you to access phi_m in all grid points. So you will have to follow one of the ways described he...

mehr als 3 Jahre vor | 0

Beantwortet
What is the difference between "any" and "all" function?
vec = [0 5 7]; Is any element of "vec" equal to zero ? Yes, the first one: any(vec) Are all elements of "vec" equal to zero ?...

mehr als 3 Jahre vor | 1

Beantwortet
Solve a system of differential equations which has blkdiag
You can't supply it as a global, but only pass it as a function handle: B = @(x) blkdiag(kron(x.',eye(2))) Or you define it as...

mehr als 3 Jahre vor | 0

Beantwortet
Keep getting a blank graph
I don't understand why you ask the same question again. It has already been anwered here: https://de.mathworks.com/matlabcentr...

mehr als 3 Jahre vor | 0

Beantwortet
error while solving the coupled ode
% Defining parameters delta = 0.02; % Lower integral bound R = 5; % Upper integral bound theta = 0; ...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
How can I get a variable that starts in t=0?
y = cumprod([500;ins_urz])

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
save loop data with non integer steps
reduced_scattering_coeff = 10; absorbing_coeff = 1; source_detector_distance= 1.5; refection_parameter= 3.25; absorbing_coef...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Trouble calculating Fourier series coefficients for full wave rectified sine wave.
clear % Create symbolic variable syms t % Define variables for waveform A=170; f0=60; T0=1/60; n=1:100; % Initial ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Help with fmincon, non-linear constraints and binary variables
It doesn't work because fmincon only handles continuous variables and functions. Use "intlinprog" instead. Here you can define ...

mehr als 3 Jahre vor | 2

| akzeptiert

Beantwortet
Biological Effective Dose (BED)
Assuming you have two arrays (time_h and TAC) of the same length: AlphaBeta = 2.6; mu = 0.3571; S = 1; int_inner = cumtrapz(...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Is there a way to reduce execution time of the following because it took 6 hours and still is executing?
Are you sure you can use "ga" with stochastic inputs that change from iteration to iteration ? I doubt it. Look up "stochastic ...

mehr als 3 Jahre vor | 1

Beantwortet
Failure at t=2.013823e-01. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (4.440892e-16) at time t.
Works. par=[1.5e-8,1.0e-8,0.1,1668115,2748508,20,50]; time=100; [sol]=SIQR(par,time); tv=0:1:time; hold on width =3; he...

mehr als 3 Jahre vor | 1

Beantwortet
Error: Operator '*' is not supported for operands of type 'function_handle'.
cb = 1/5.25; %reverse of aspect ratio cla = 2*pi; %the slope of lift vs aoa aa = 5*pi/180; % radiant value of 5 degree N = [3...

mehr als 3 Jahre vor | 0

Beantwortet
How can i correct my code in order to produce the solutions of a function from fsolve?
k is an array of length 22, a is an array of length 100. Both are part of your sum expression... Incompatibility is a consequenc...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
solve system of matrices
Should be faster than the symbolic solution. rng("default") n = 50; A = rand(n-1); B = rand(n-1); C = rand(n-1); x0 = zero...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How can I find out the index of the points here?
X = [0,10,0,-10,0,5,0,-5] Y = [10,0,-10,0,5,0,-5,0] syms x y g1 = (y-2)/(x-1.5) == (-1.5-2)/(-1.5-1.5); g2 = (y-2)/(x-(-1....

mehr als 3 Jahre vor | 1

Beantwortet
Trying to rearrange equation using syms
Maybe you mean syms v g LD SFC W_start W_end s eqn = s == (v*(LD))/(g*SFC)*log(W_start/W_end); sol = solve(eqn,LD)

mehr als 3 Jahre vor | 0

Mehr laden