回答済み
how can i loop a cvs file so that it weeds positive results out of the negative results and separates them into different age groups
This pulls out positive results from a positive / negative result chart: X = X(X>0) This assigns the positive results to each ...

3年以上 前 | 0

| 採用済み

回答済み
Error: Index in position 2 exceeds array bounds. Index must not exceed 1.
You defined a variable called "zeros": zeros = [1; -1]; This conficts with the MATLAB function to define an array of zeros: y...

3年以上 前 | 0

| 採用済み

回答済み
Pdepe- Spacial Discretization has failed. Trying to solve a heat transfer equation and I'm confused on how to definte the boundary conditions for my case
At the moment, your boundary conditions read k*dT/dx = -40 at x = 0 k*dT/dx = -T at x = L I don't think this is what you try...

3年以上 前 | 0

回答済み
simulation takes hours to run. ''variable appears to change size on every loop iteration( within a script). how do I preallocate for speed please?
Preallocate it with the largest possible size. But if the simulation takes hours, I doubt the missing preallocation is the bottl...

3年以上 前 | 0

| 採用済み

回答済み
How do I place a point anywhere along x axis (with range 100m) in a plot?
x0 = 53; y0 = 0; plot(x0,y0,'o') ylim([0 1]) xlim([0 100])

3年以上 前 | 0

| 採用済み

回答済み
can someone help with this error please
Instead of tspan = [0,2] use tspan = linspace(0,2,100) This fixes the number of output times to 100 for both calls to ode45...

3年以上 前 | 1

回答済み
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...

3年以上 前 | 0

回答済み
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...

3年以上 前 | 1

| 採用済み

回答済み
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))...

3年以上 前 | 1

| 採用済み

回答済み
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)*...

3年以上 前 | 1

| 採用済み

回答済み
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...

3年以上 前 | 1

回答済み
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...

3年以上 前 | 0

回答済み
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); ...

3年以上 前 | 0

回答済み
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).

3年以上 前 | 0

回答済み
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 ...

3年以上 前 | 0

回答済み
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)

3年以上 前 | 0

回答済み
How to extend x range of pwelch
Multiply the result from pwelch by 10. :-)

3年以上 前 | 0

| 採用済み

回答済み
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...

3年以上 前 | 0

回答済み
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.

3年以上 前 | 0

| 採用済み

回答済み
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 = (...

3年以上 前 | 0

回答済み
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...

3年以上 前 | 0

回答済み
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...

3年以上 前 | 0

回答済み
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 ...

3年以上 前 | 0

| 採用済み

回答済み
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./(...

3年以上 前 | 1

| 採用済み

回答済み
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...

3年以上 前 | 0

回答済み
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;...

3年以上 前 | 0

| 採用済み

回答済み
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...

3年以上 前 | 0

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

3年以上 前 | 2

回答済み
How to use lsqnonlin with multiple constraints?
Use lb and ub in the list of inputs to "lsqnonlin".

3年以上 前 | 1

回答済み
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];

3年以上 前 | 0

さらに読み込む