Beantwortet
Solving multi-variable ODE
Use interp1 to interpolate the vector values for v and dv/dr to the values r requested by the solver. The example ODE with Tim...

mehr als 3 Jahre vor | 0

Beantwortet
Solving multi-variable ODE
If nu(r) is known, you have to insert the expressions for nu(r) and dnu/dr in your equation for eta. If nu(r) is unknown, you m...

mehr als 3 Jahre vor | 0

Beantwortet
I am facing error while solving two 2nd order differential equation in which boundary condition are dependent to each other. Any idea where I am doing wrong??
syms y1(z) y2(z) z C11 C12 C21 C22 K1 = 1; K2 = 1; K3 = 1; eqn1 = diff(y1,z,2) - y1/K1 == K2; eqn2 = diff(y2,z,2) == K3; s...

mehr als 3 Jahre vor | 0

Beantwortet
evaluate a symbolic function of t that contains a derivative relative to t
It should be possible to evaluate tau right? syms Q(t) t Q_dot = diff(Q, t); tau = 2*Q + Q_dot % tau = 2*Q(t) + diff(Q(t),t)...

mehr als 3 Jahre vor | 0

Beantwortet
Summation in MATLAB in 4 dimenstion
for t = 1:T s(t) = 0; for i=1:i <---- for i=1:i does not make sense for j=97:176 if w(i,j,15,t)<0 ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
ind2sub with arbitrary martix
You mean A = rand(5,6); s = size(A) ?

mehr als 3 Jahre vor | 0

Beantwortet
Multi functions multi variables optimization
Use fmincon. Define the constraints 1<a<2; 2<b<3; 3<c<4; 4<d<5; 5<e<6 in lb and ub, define the constraints 0<F(a,b,c,d,e)<...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
solve system by converting a matrix to vector
n = 4; A = rand(2*(n-1),2*(n-1)); b = rand(2*(n-1),n-1); x = A\b u = x(1:n-1,:) v = x(n:2*(n-1),:)

mehr als 3 Jahre vor | 1

Beantwortet
Optimize the construction of a function for quadrature purposes
MyInt = integral(@myfun, 0, 2*pi) function Output = myfun(t) p = (1:20).'; Output = sum(1./p.*cos(p.*t) + 1./(2*p).*sin...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
bvp4c or bvp5c code needed for 2nd order BVP having unknown parameters.
syms u(y) y syms M P h k real eqn = diff(u,y,2)-M^2*u==P; conds = [u(h)==1,u(k)==1]; dsolve(eqn,conds)

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to calculate R^2 using 1 - (SSR/SST)? For normal fit distribution.
In my opinion, it does not make sense to fit a linear function to the value pairs (cdf(normalfit, actual_values),Table.nonExceed...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to generate Pareto front for an external function ?
Use "gamultiobj".

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
3d implicit function plot with the sign function
MATLAB assumes that the function f you provide is continuous. For x+y+z =1, the function returns -0.1, for all other triples for...

mehr als 3 Jahre vor | 0

Beantwortet
Array indices must be positive integers or logical values. - specific to EEG data
Rename this variable - it conflicts with MATLAB's "fft" function. fft = 2^nextpow2(57001);

mehr als 3 Jahre vor | 0

Beantwortet
How to integrate over the entire bounds of a solution to a PDE at a given time step using PDEPE
How can I integrate over the entire geometry to find the total concentration at each time step? Do I have use PDEPE for small st...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Loop for 1:100
A_cont is a matrix of size 101 x 201. In row i of A_cont, the array AH(1:101) is stored in columns i to i+100 (thus in the part...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
Using trapz to obtain the AUC over a fixed bin
If the x-values are 1,2,3,... dff = rand(115305,1); for i = 1:floor(numel(dff)/600) AUC(i) = trapz(dff((i-1)*600+1:i*600)...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Empty Sym: 0-by-1
f = @(y) cosh(y).*sinh(y)-5/3*y ; y = 0:0.01:1 ; plot(y,f(y)) syms x y assume (x,'real') eqn = cosh(y).*sinh(y)-5/3*y==0; ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How do you make the diagonal and certain off-diagonal elements of a matrix zero?
n = 9; A = rand(n) for i=1:n-1 A(i,i+1) = 0.0; A(i+1,i) = 0.0; end A

mehr als 3 Jahre vor | 0

Beantwortet
Retrieving numbers present within an array by knowing the coordinates
image_DEF_numero_pixel = importdata('image_DEF_numero_pixel.mat') union = importdata('union.mat') vector = arrayfun(@(x,y)imag...

mehr als 3 Jahre vor | 0

Beantwortet
Having trouble solving two second order ODEs simultaneously
According to your equations in the graphics, these terms in the MATLAB code are wrong: - (1/Dij)*(2*diff(Rj,t)*diff(Rj,t,2)^2+ ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Problem with calculating the negative are enclosed between a curve and the x-axis
Try idx = y<=0; jdx = y>=0; xn = x(idx); yn = y(idx); xp = x(jdx); yp = y(jdx); [xn,I] = sort(xn); yn = yn(I) [xp,J] = ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Optimization of a simple composite structure
Why not varying the angle between -90 and 90 in steps of delta_theta and choosing the value of minimum deflection ? Do the fin...

mehr als 3 Jahre vor | 1

Beantwortet
Why do I keep getting a zero for x(9) for Backward subsitution?
Don't generate random numbers that can become 0 on the diagonal. Or use your code to check if all U(i,i) are not equal 0. Furth...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
Solving for the parameters of a distribution
The formula for the quantiles of the lognormal distribution as a function of p, mu and sigma is given here: https://en.wikipedi...

mehr als 3 Jahre vor | 0

Beantwortet
How to solve an equation with arrays
syms b k_eff % reflector Dr=0.088; Sa_r=0.0033; %core Dc=1.45; Sa_c=0.0044; nu=2.5; Sf=0.0032; a=30; eqn = Dc*sqrt(-(2...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to plot empirical cdf and fitted distributions cdfs?
Table = readtable("practice3.xlsx"); a = Table.values; a = sort(a); hold on cdfplot(a); % Make a plot of the empirical CDF ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Not sure why I am getting errors for my anonymous functions.
This would work: k = randn(1); % random variable % define all of your variables below f = @(x) (sin(x)+4*x)./x.^2; A = f(5);...

mehr als 3 Jahre vor | 0

Beantwortet
lsqcurvefit question - ydata has two dimension (Function value and YDATA sizes are not equal)
Your function "fun" must return a matrix of size (60x2) like the ydata you provide. This is not the case - thus the error messag...

mehr als 3 Jahre vor | 1

Beantwortet
Is there a function to determine the non-exceedance probability of each value in the table?
You will first have to tell us the type of distribution the values are supposed to follow (e.g. log-normal distribution). After...

mehr als 3 Jahre vor | 0

Mehr laden