Answered
Error in plotting a function, left and right side with diferent dimensions
Most probably, vet_servido(j) = - (1/2) * log(1- x_exp(j)); instead of vet_servido(j) = - (1/2) * log(1- x_exp);

3 years ago | 0

| accepted

Answered
Left division with partially known coefficient
It's a nonlinear fitting problem - backslash doesn't suffice here. I set p = 1/(d*K) . If you like, you can retransform the res...

3 years ago | 0

| accepted

Answered
Why do I get "Array indices must be positive integers or logical values"?
Ta = 504; y = 1.4; Ra = 1716; M = .1:.1:5; for i = 1:numel(M) u(i) = M(i)*sqrt(y*Ra*Ta); end plot(M,u) or simply Ta...

3 years ago | 0

Answered
numerical integration theorem of residues
You can define the function to be integrated in a function - you don't need to use handles. In this function, you can perform a...

3 years ago | 0

| accepted

Answered
Integral of matrix determinant
f=@(x)det([1,x;0,2]); integral(f,0,1,'ArrayValued',true)

3 years ago | 0

| accepted

Answered
custom logarithmic fit with three coefficients
It doesn't make sense to use three fitting parameters for the function type you supply. a + b*log(c*x) = a + b*log(c) + b*log(x...

3 years ago | 0

| accepted

Answered
lsqcurvefit for multiple variables optimization
We need your "YL_function" to see what's happening. I wonder whether your transformation is correct. I would have thought y_r...

3 years ago | 0

| accepted

Answered
Absurd result using 'integral2' with non-"centered" functions
It's not possible for integral2 to capture the small peak around 50 to return 1 as result. Use result = mvncdf([-Inf -Inf],[In...

3 years ago | 1

| accepted

Answered
fminsearch output size bigger than the variables to optimize?
[10000 1000 0.2] instead of [10000 1000 0,2] as the vector of initial conditions. MATLAB is not Excel.

3 years ago | 0

| accepted

Answered
How do I properly use the "while", "for", "loop" command in this problem?
A = [71.213; 74.499; 79.175; 54.163; 83.008; 52.615]; %Column vector B = length(A); %size of column (number of elements) %H =...

3 years ago | 1

| accepted

Answered
I want to show r^2 and the poly1 ec on the plot
format short g %datos del equipo df=6.1; %cm hf=25; %cm dtr=35; %cm htr=62; %cm %datos del usuario V1=60; V2=0; Vr=V1...

3 years ago | 1

| accepted

Answered
The method fminsearch() cannot find minimum of quadratic form for 5 variables
The fact that the solvers have the same name under "Octave" and "MATLAB" doesn't mean they are identical - they only have the sa...

3 years ago | 0

| accepted

Answered
Plotting a system of non-linear ODES to model tumour volume.
lotka = @(t,y)[(1.2*(y(1)-0.8))*((1-y(1)-(1-y(1))^(2/3)));1.2*y(2)*(y(1)-0.8)]; t0 = 0; tfinal = 100; y0= [0.5;0]; [t,y] = o...

3 years ago | 0

Answered
How do I fix this interpolation error
You can only inverse interpolate if your vector "exprmentresult" is strictly increasing or strictly decreasing. Since it contain...

3 years ago | 0

Answered
code is right but can not the a plot
If you compare size(t) and size(u,1), you will find that the number of elements of both vectors are not the same (they differ by...

3 years ago | 1

Answered
The Staff Scheduling Problem,Loops Constraints,
Do you want to enlarge the problem size ? If not, why writing 7 clearly arranged constraints in a complicated loop ? But if you...

3 years ago | 0

| accepted

Answered
Error using odearguments (line 95)
For the code to work, x1 in the commands R1new = interp1(SOC',R1',x1); R2new = interp1(SOC',R2',x1); C1new = interp1(SOC',C1'...

3 years ago | 0

Answered
I want to plot y vs. B
B >= 1 ? B = 1:0.1:10; y = arrayfun(@(B) 2/sqrt(pi)*integral(@(x)x.^0.5./(B*exp(x)-1),0,Inf),B); plot(B,y) grid on

3 years ago | 0

| accepted

Answered
how do i solve this equation using matlab
T = @(x,y,z,t) 2*A*P_max*sqrt(alpha)/(k*pi^(2/3)*r^2)*integral(@(u)1./(1+4*alpha*u.^2/r^2).*exp(-(x^2+y^2)./(r^2+4*alpha*u.^2)-z...

3 years ago | 0

Answered
How can i integrate an array using the trapz function
Use cumtrapz instead.

3 years ago | 0

| accepted

Answered
is the objective function stochastic (-> use something like patternsearch) or deterministic?
Since I add the noise just once a priori to the optimization, my objective function is still deterministic, right? Right, but w...

3 years ago | 0

| accepted

Answered
Solving a system of second order ODE backwards
An example: fun = @(t,y) y; [t1,y1] = ode45(fun,0:0.01:1,1); [t2,y2] = ode45(fun,1:-0.01:0,exp(1)); hold on plot(t1,y1) pl...

3 years ago | 1

Answered
How to create for loop
You see the reason (see above) ? The degree of the denominator is bigger than the degree of the numerator. Thus k1,k2,k3 and k4...

3 years ago | 0

Answered
Why will my multi-dimensional Newton Method not converge?
Your Jacobian is wrong. You didn't specify J(i,i-1),J(i,i+1),J(i,i-N),J(i,i+N). Only computing the diagonal is not sufficient fo...

3 years ago | 0

| accepted

Answered
how to use fsolve for non linear functions with some equations are the same form?
You can solve systems with more unknowns than equations, but in most cases ( as in yours ), the solution will not be unique. Th...

3 years ago | 0

| accepted

Answered
Use Problem-Based Optimize solve the "Or Constraints" problem,which showed in the chapter of "Solver-Based Optimization Problem Setup"
clc,clear prob=optimproblem; x=optimvar('x',2); x0.x=[-0.5,0.6]; fun = exp(x(1)) * (4*x(1)^2 + 2*x(2)^2 + 4*x(1)*x(2) + 2*x(...

3 years ago | 0

| accepted

Answered
Nonlinear curve fitting with summation function
Check again whether fun is correctly defined. I changed ri to rj in the last log expression. % Load data from Excel file data...

3 years ago | 0

| accepted

Answered
Thomas algorithm - tridiagonal matrix
clear cm=1/100; delta = 1*cm; nu=1e-6; Uinf=1; H=2*delta; y=linspace(0,H,40); u=Uinf*erf(3*y/delta); dy=mean(diff(y)); ...

3 years ago | 0

| accepted

Answered
Why the function like (1 - cosd(x)) / cosd(x) doesn't create an vector and can't plot?
%sin und cos in degree sind sind() und cosd() F_rel_a = (R - sind(x))./sind(x) F_rel_c = (1 - cosd(x))./cosd(x) instead of %...

3 years ago | 0

Answered
Error with my MATLAB code
E0 and Es are undefined. syms t s Gs Gt Ks Es Et MSU1 = readtable('Relaxation data.xlsx','Range','A4:E82'); E00 = 8567.19; v...

3 years ago | 0

Load more