답변 있음
Operands to the logical AND (&&) and OR (||) operators must be convertible to logical scalar values. Use the ANY or ALL functions to reduce operands to logical scalar values.
if all(abs(grad_g1_val) < tol) && subs(g1, {x1, x2, x3}, x') <= 0 activeSet = [activeSet, 1]; % Constraint 1 is ac...

19일 전 | 0

| 수락됨

답변 있음
ODE45 and dsolve result difference
dydx(2)=2-2*y(2)-8*x; instead of dydx(2)=2-2*y(2)-8*y(1);

19일 전 | 1

| 수락됨

답변 있음
Intersection condition between two ellipses
I'm surprised that we get a division by zero by the below solution method if the aspect ratio of the two ellipses is equal. Bu...

19일 전 | 0

답변 있음
Arrayfun with Extra Parameters
Test3 = arrayfun(f,a,b) instead of Test3 = arrayfun(@f,a,b)

19일 전 | 0

| 수락됨

답변 있음
Extract the indices based on the minimum absolute value
Maybe you mean %define the number of random numbers n = 10; %define the min and max ranges of random values stvar = [0 4]...

19일 전 | 0

답변 있음
How to fit a distribution whose parameters depend on other parameters?
In this case, you must assume a parametric expression for T(z) as well (e.g. T(z) = a + b*z) and add a and b to the parameters t...

20일 전 | 0

답변 있음
Solve and plot system in x and y with varying constants e and t
basically i would like to obtain on the same graph different curves in x and y for a fixed number of combinations of e and t. I...

21일 전 | 0

| 수락됨

답변 있음
sol2 = bvp4c(@bvpexam2, @bcexam2, sol);
Ibrardual() function Ibrardual Nt=0.5; Nb=0.5; Le=2; Pr=1; Alpha=[-0.2138;-0.4]; s=1; A=1; %% solution in structure form %...

21일 전 | 0

| 수락됨

답변 있음
What is the most computationally efficient factorization of a matrix A?
Prove that the matrix is positive definite and count the number of FLOPs of Cholesky compared to the other factorizations. Sect...

22일 전 | 0

답변 있음
what is the error here?
The error is that the parameter "S" is not an input to function "odeBVP" and thus undefined in f =[y(2);y(3);(1/3)*D1*((y(2)^2...

23일 전 | 0

답변 있음
Runge kutta giving complex numbers
It doesn't make sense to use such discontinuous input data for the solution of a differential equation. Solving a differential ...

25일 전 | 0

답변 있음
How does Matlabs Symbolic Math Toolbox always finds an analytical eigendecomposition for arbitrary polynomial matrices?
For me this begs the question, is the eigenvalue polynomial from eig(...) truly analytic? What do you mean for a polynomial to ...

25일 전 | 1

| 수락됨

답변 있음
Want to understand how to implement in matlab the following differential equation?
If you know P1 over time, you don't have a differential equation, but simply an algebraic relation to determine Q: Q = (P1-P2)/...

25일 전 | 0

답변 있음
Coding the Thomas algorithm for a heat and mass transfer problem
When I run the function, I get: Not enough input arguments. Error in solvePDEs (line 27) y(n) = linspace(y_span(1), y_s...

26일 전 | 1

| 수락됨

답변 있음
Mapreduce with tall array in matrix multiplication
Would this work for you ? B = ones(2,3); A = tall(ones(200,2)); values = A*B; gather(values)

26일 전 | 0

답변 있음
Does pdepe accept 'Vectorized', 'on' as an option? If so, what does it do?
If you look into the documentation for "pdepe", you will find that the "Vectorized" option cannot be chosen: Cited from the doc...

27일 전 | 0

| 수락됨

답변 있음
Complex Integration in MATLAB with symbolic integration limits
Does this help ? Note that no distiction is made about the R-value. But you should keep in mind that the answer is incorrect i...

27일 전 | 0

| 수락됨

답변 있음
how i can change column vector into row vector??
Simply converting a row vector into a column vector needs the usual transpose operator which is .' You used only ' with is conju...

29일 전 | 0

답변 있음
Does cummax works in a sde solver?
My question is: does here cummax works on all previous values of X(2)-X(1), or it takes it as a scalar at every iteration? It t...

29일 전 | 0

답변 있음
H have a error in FDM.
F(i+1) = (F(i) + F(i+2))/2 -H(i)*(h/2)*(F(i+1)-F(i)) +(h^2)*(G(i)^2) - (h^2)*(F(i)^2) + (h^2)*(S/2)*((((i*h)+1)/2)*((F(i+...

30일 전 | 0

| 수락됨

답변 있음
Error using matlab.internal.math.interp1 Input coordinates must be real.
For some reason, the k suggested by "fminbnd" becomes complex-valued so that interpolation in function "valfunsto" is no longer ...

30일 전 | 0

| 수락됨

답변 있음
Computing Partial derivates of anonymous functions comprised of sum of standard functions
Your code works for me. Maybe you have a MATLAB version where the second argument to "diff" is only interpreted as the order of ...

대략 1개월 전 | 0

답변 있음
Computing Partial derivates of anonymous functions comprised of sum of standard functions
Stay numerical in your computation and approximate the gradient of your objective function "obj" by finite-difference quotients:...

대략 1개월 전 | 0

| 수락됨

답변 있음
How do I optimize/find the minimum of a multi-variable function?
If you don't restrict your x- and y- variables to certain lower and upper bounds, the minimum of the function your get from "fit...

대략 1개월 전 | 0

답변 있음
Can I use fmincon with a whole model as function?
I don't see your problem. You call "fmincon" as sol = fmincon(@fun,x0) and write a function "fun" as function obj = fun(x) ...

대략 1개월 전 | 0

| 수락됨

답변 있음
Regarding choosing correct boundary condition
If you set qL = 1 and qr = 1 and you defined f as f = D*du/dx in the function where you need to specify [c,f,s], you can specify...

대략 1개월 전 | 0

| 수락됨

답변 있음
How to interpolate 2-parameter dependents matrices?
Use griddedInterpolant or scatteredInterpolant on each matrix element separately depending on whether the point pairs (Vi,qj) fo...

대략 1개월 전 | 0

답변 있음
Mathematical Equations to MATLAB
%Parameters beta = 2; alpha = 200; Ccl = 2000; Cpm = 2500; Rl = 1100; Cren = 50000; delta = 0.223; P = 12; N = 8; Clo...

대략 1개월 전 | 0

| 수락됨

답변 있음
How can I replace NaN in a table with a zero?
https://uk.mathworks.com/matlabcentral/answers/231096-replace-nan-s-in-table-with-zero

대략 1개월 전 | 0

더 보기