Beantwortet
Hi, can someone help me with this. It gives table function error "Index exceeds the number of array elements. Index must not exceed 1.” I’m finding it hard to locate error.
My guess is that one of the arrays you address in your code (AR_1_CV;AI_CV;ARTC_CV;FC_CV;ACT_BEV;ACR_CV;ACS_CV;OC_CV;Depre_CV;AT...

etwa 3 Jahre vor | 0

Beantwortet
Plotting from For Loop ODEFUN and BVP4C Initial Guess
global m Pr etainf = 20; % Find Convergence for both Temp and Velocity %% Thetadot(0) vs Pr m = 0; PR = 0:0.5:50; f...

etwa 3 Jahre vor | 1

| akzeptiert

Beantwortet
Cantor function in matlab
N = 20; f{1} = @(x) x; for i = 1:N-1 f{i+1} = @(x)(0.5*f{i}(3*x).*(x<=1/3) + 0.5.*(x>1/3 & x<2/3) + (0.5+0.5*f{i}(3*x-2))...

etwa 3 Jahre vor | 1

| akzeptiert

Beantwortet
How to solve these 3 equations with 3 variables which are in radian.
syms t1 t2 t3 eqn1 = 140 + 140*cos(t1)*sin(t2)*sin(t3)-140*cos(t1)*cos(t2)*cos(t3)-180*cos(t1)*sin(t2)==0; eqn2 = 140*sin(t1)*...

etwa 3 Jahre vor | 1

| akzeptiert

Beantwortet
How to interpolate from a dataset using interp3?
It's completely unlogical, but the documentation of interp3 says: If X, Y, and Z are grid vectors, then size(V) = [length(Y) le...

etwa 3 Jahre vor | 1

Beantwortet
How do I pass inputs into external functions from ode45?
This code works without syntax errors, but you should pass all your parameters to "func" and distribute them from there among th...

etwa 3 Jahre vor | 0

Beantwortet
Create for loop to calculate irr
syms r n N symsum(1/(1+r)^n,n,1,N) ko = 100; tot_profit = 7; n = 30; fun = @(r) -ko + tot_profit* ((r+1)^n-1)/(r*(r+1)^n); ...

etwa 3 Jahre vor | 0

Beantwortet
I think the ode45 code that I wrote works, but how do I plot it together with both forward and backward euler methods?
I changed your code as to make it work (see above).

etwa 3 Jahre vor | 0

Beantwortet
How can I define initial condition in a for loop?
syms x y(x) Dy = diff(y); sol = dsolve(diff(y,x,2)+y==0,y(0)==9,Dy(0)==9) v_0 = [9;9]; T = 10; dt = 0.0001; N = T/dt; v ...

etwa 3 Jahre vor | 0

Beantwortet
I want to integrate a symbolic matrix numerically. How can I do it??
syms x y A = [1 x^2+y^2;x-y x^2+y^2]; IntA = int(int(A,x,0,10),y,0,15)

etwa 3 Jahre vor | 0

Beantwortet
How to extend x range of pwelch
Multiply the result from pwelch by 10. :-)

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
Creating Distribution by Specifying Densities
If the masses add to 1, your x-coordinates together with the probability masses already define the distribution. There is no rea...

etwa 3 Jahre vor | 0

Beantwortet
Trying to solve Line 5: Parse error at x0: usage might be invalid MATLAB syntax.
Works (see above). Functions have to be placed after the script part of your code.

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
Please how can I writ this function in Matlab
if (D-A*B)^2<=(1+B)*C^2*(A+D) E_min = (2*C^2+(-1+B)*(-A+D)+2*abs(C)*sqrt(C^2+(-1+B)*(-A+D)))/(-1+B)^2; else E_min = (...

etwa 3 Jahre vor | 0

Beantwortet
using lsqnonlin with multiple functions
So you want sum(((x(1)*(lambda.^(x(4)-1) -lambda.^(-.5*x(4)-1))+x(2)*(lambda.^(x(5)-1) -lambda.^(-.5*x(5)-1))+x(3)*(lambda.^(x...

etwa 3 Jahre vor | 0

Beantwortet
I need a band pentadiagonal algorithm solver. To solve the system of linear equation Ax=b, where A is a band pentadiagonal matrix.
Define A using "spdiags" and use backslash to solve. I doubt a self-written solver for banded matrices will be faster and/or mo...

etwa 3 Jahre vor | 0

Beantwortet
I am trying to solve the non-linear solver 'fsolve' to solve the rate equations. But the f(x) shows unprecedented high values and its shows no solution found.
Here is a symbolic solution of your problem. It seems to boil down to determine the roots of a polynomial of order 6. Since you ...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
Numerically solving a diffusion equation with a piecewise initial condition
I changed V(i,j) = sum((4./(k.*pi).^2).*sin(k.*pi/2).* sin(k.*pi.*x(j)).*exp(-0.5.*t(i).*(k.*pi).^2)); to V(i,j) = sum((4./(...

etwa 3 Jahre vor | 1

| akzeptiert

Beantwortet
Error in Fmincon, objective function must return scalar
F_S1 = wblpdf(d,mu_Sr1,sig_Sr1) F_S2 = wblpdf(d,mu_Sr2,sig_Sr2) F_S3 = wblpdf(d,mu_Sr3,sig_Sr3) d is a vector with six values...

etwa 3 Jahre vor | 0

Beantwortet
Hi all, can anyone please help to create code for the condition bellow
x = 10:20:200; y = 0.1:0.08:1; [X,Y] = meshgrid(x,y); Z = zeros(size(X)); Z(X<=60) = 8.1.*0.7.*X(X<=60); Z(X>60) = 8.1.*42;...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
ploting of a serie
N = 53; tstart = 0.0; tend = 0.75; dt = 0.015; t= tstart:dt:tend; t = t.'; n = 0:floor(N/2); c=[0.16192008 0.05711...

etwa 3 Jahre vor | 0

Beantwortet
Normalization of probability distribution function
I think the kernel density is already normalized ... From the documentation: [f,xi] = ksdensity(x) returns a probability densi...

etwa 3 Jahre vor | 2

Beantwortet
How to use lsqnonlin with multiple constraints?
Use lb and ub in the list of inputs to "lsqnonlin".

etwa 3 Jahre vor | 1

Beantwortet
Error using semilogx Vectors must be the same length.
Use A=@ (w) 1./(1 -(Wb./w).^2 - 1i*2*Wb./w); instead of A=@ (w) 1./[1 -(Wb./w).^2 - 1i*2*Wb./w];

etwa 3 Jahre vor | 0

Beantwortet
BVP4C:error Unable to solve the collocation equation -- a singular jacobian encountered
As I said before: Remove x=0 from your interval of integration to avoid a division-by-zero. Nonetheless, bvp4c has problems wit...

etwa 3 Jahre vor | 1

| akzeptiert

Beantwortet
Error in double integration
syms r ph phi lam=532*10^-9; z=100; k=2*pi/lam; omega=30; w0=0.002;m=1;rho=1;p=1; E = 1./(w0^2) + (1i*k)./(2*z); Con1=(1i...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
How do i find the global minimum of chi^2 function of two variables?
Turn the function you want to minimize using a numerical solver like "fminunc" or "fmincon" into a function with numerical argum...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
Solving coupled differential equations
MATLAB is not able to get a solution. Take the one from WolframAlpha: https://www.wolframalpha.com/input?i=y%27%28t%29+%3D+-f%2...

etwa 3 Jahre vor | 0

Beantwortet
When integrating numerically with Integral 2, the integral contains a vector, resulting in an error: Arrays have incompatible sizes for this operation.
R = 5; r = 6:0.1:9; theta = [0,pi/6,pi/4]; %A = @(r,theta,rr,phii) ((r.*sin(theta)-rr.*sin(phii)).^2+r.^2.*cos(theta).^2+rr.^...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
Issues when stracting from an ODE 45 that depends on a derivative
yc and t are scalars, thus single values. diff(yc)/diff(t) makes no sense in this case. Simply use dyc = -2*sin(t)

etwa 3 Jahre vor | 0

| akzeptiert

Mehr laden