Answered
Problem fitting the curve with fminsearch
Using a polynomial of degree 5 to fit your data is a bad idea because the higher the degree, the greater the oscillations betwee...

2 years ago | 1

Answered
Solve a matrix that has nonlinear coefficients
If the coefficients contain the unknowns, a matrix representation of your system of equations leads you nowhere. Write your sys...

2 years ago | 0

| accepted

Answered
How can I solve this PDE kinetics equation with Symbolic Toolbox?
PDEs cannot be solved with the symbolic toolbox. Use "pdepe" as numerical solver instead.

2 years ago | 0

Answered
Modify the following code to get all the outputs of all Mach number at once
% Gas properties cpc = 1.005; % kJ/kg.K cph = 1.156; % kJ/kg.K gac = 1.4; gah = 1.33; R = 287; % J/kg.K % Fuel QR = 42000...

2 years ago | 0

Answered
How to include zero contour
You want to plot imag(taumin(U,xi)) = 0. Thus use fimplicit: https://uk.mathworks.com/help/matlab/ref/fimplicit.html

2 years ago | 0

Answered
Heat equation using Boundary condition
x=linspace(0,1,20); t=linspace(0,2,10); u=pdepe(0,@eql,@initial,@ba,x,t); surf(x,t,u) title('Surface plot of solution')...

2 years ago | 0

Answered
unable to get code to run please help
This should be the rough structure of the optimization code. But you don't use your optimization variable P in the objective fun...

2 years ago | 0

Answered
¿Cómo puedo hacer el campo de direcciones y resolver el PVI y(0)=1 de la siguiente EDO dy/dx=e^(-0.01xy^2)?
The message means that MATLAB cannot find an analytical solution to your differential equation. You will have to use ode45 to ge...

2 years ago | 1

| accepted

Answered
how get it?
a = magic(5) b = [1 3 2 4 5] v = arrayfun(@(i)a(b(i),i),1:size(a,2))

2 years ago | 1

Answered
How do you set up an ode solver with a more than one function in the ode?
If you have two unknown functions (f and g), you need two equations.

2 years ago | 0

Answered
dimensions of array being concatenated are not consistent
b = [779.3-780*R(k); 76]; instead of b = [779.3-780*R; 76]; But why do you use such a complicated code for 2x2 linear systems...

2 years ago | 0

Answered
Error using odearguments: returns a vector of length 1, but the length of initial conditions vector is 5.
tspan = [0 100]; SOL0 = [10;0;0;0;0]; [W,SOL] = ode15s(@(w,sol)fun(sol(1),sol(2),sol(3),sol(4),sol(5)),tspan,SOL0); plot(W,SO...

2 years ago | 1

| accepted

Answered
Automatic substitution of a symbolic variable with a numerical value
The a in the symbolic equation exp = str2sym('c = a + b'); is not associated with the a = 1 in the first line. This would...

2 years ago | 0

Answered
Estimating the parameter of a complex equation using maximum likelihood estimation (MLE) method
And this is a probability distribution for arbitrary values of q1, q2, A, lambda, beta1 and beta2 ? I can't believe. If you wer...

2 years ago | 0

Answered
Output issues with deformation calculation
Use double(DEFAB) etc. to see the result in the usual notation.

2 years ago | 0

| accepted

Answered
contour plot with a circular boundary
If you want to plot it within a circular contour, you have a 3d-plot. For a 3d-plot, you can only plot cuts in length direction ...

2 years ago | 0

Answered
How do I get largest distance between two rows in an nx3 matrix?
max(pdist(X),[],"all") where X is your matrix.

2 years ago | 0

Answered
interpolation of values gives Inf
InterpCorr.(TitleStr)(1) is equal to 0, so you divide by 0 every time. And my guess is that your line of code should be some ki...

2 years ago | 0

| accepted

Answered
How to find the value of x if y=0 from two arrays of data?
Use interp1 if y_temperature_soil is monotonic with depth: y0 = interp1(y_temperature_soil,x_depth,0)

2 years ago | 0

| accepted

Answered
How do you solve a coupled ODE when one of the ODE results in a vector of length 3 and the other results in a scalar of length 1?
All solution components have to be aggregated in one big vector z, and also the derivatives have to be supplied in this vector f...

2 years ago | 0

| accepted

Answered
How to get best fitting Parameters for a function for all datapoints
You cannot estimate lh and lo separately in your approximating model, only their sum (lh+lo). But your model seems to return c...

2 years ago | 1

Answered
Linear Interpolation code without using interp1
How can I write a code that works faster? Allocate ynew = zeros(size(n2)) at the beginning of your code. Check whether n is mo...

2 years ago | 1

Answered
creating smaller matrix from a large matrix
You mean rng("default") A = rand(16); for i = 1:4 for j = 1:4 B = A((i-1)*4+1:i*4,(j-1)*4+1:j*4); A_c...

2 years ago | 0

Answered
indexing in the nested loop
sx = 0; sy = 0; for s = T-1:-1:0 sx = sx + x^(T-1-s); sy = sy + y^(T-1-s); ratio(s+1) = sy/(sx+K^(1/gamma)*x^(T...

2 years ago | 0

| accepted

Answered
nested loop shows only the result of last iteration
... W_t(n+1)=(1+r*(1-tau)).^(-(T-n)).*C_0*epsilon.^T.*K^(1/gamma); for m=(n+1:1:T-1) W_t(n+1)=W_t(n+1)+((C_0.*epsilon.^m...

2 years ago | 0

| accepted

Answered
I'm not sure as to why MATLAB is not outputting the figure, as well as the vector [T_Euler]. When I run the code it is fine, but when publishing I don't see either. Any fixes?
%% problem description % Determine the temperature vs time for hot iron with convection and % radiation. HW3_prob4_driver()...

2 years ago | 0

Answered
I don't know why this code doesn't stops :(
res(3) == 0 and res(4) == 0 are two nonlinear equations in the unknowns yp(3) and yp(4). ode15i seems to have problems following...

2 years ago | 0

Answered
Delay differential equations where every variable can take on multiple delays
I don't understand your mathematical formulation. Should the summation be over j instead of i ? And shouldn't there be a bracket...

2 years ago | 0

| accepted

Answered
Solving Multi-variable Partial Differential Equation
The only thing you can get with the "boundary condition" you gave is the solution on the characteristic curve of the PDE through...

2 years ago | 1

| accepted

Answered
Curve fitting with more than 3 variables
Do you really think that there is a causal correlation between the housenumber and the energy from the grid ? So if the house nu...

2 years ago | 1

Load more