Réponse apportée
operator '*' is not supported for operands of type 'function_handle'.
This question (or the equivalent) gets asked over and over again. I can understand where things get confusing. For example: f =...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Why does MATLAB (Symbolic Math Toolbox) not integrate this simple function.
Your problem is, you need to define a properly. So, if you do only this: syms x a I = int((1-x^2/a^2)^(3/2),x) Now you see th...

environ 4 ans il y a | 1

Réponse apportée
How to generate a matrix with random numbers between 0 and 1 and mean of the distribution is unspecified.
You need to understand the difference between a sample mean, and the population mean. x = rand(1,100); mean(x) This is a rand...

environ 4 ans il y a | 0

Réponse apportée
fmincon solution different for different start values
There are many scenarios where a solver can produce different solutions for different start values. First, know that fmincon is ...

environ 4 ans il y a | 1

Réponse apportée
Spline vs Linear Interpolation
This is not remotely a question about MATLAB. I'll answer it only because I have some time, and because I do understand interpol...

environ 4 ans il y a | 3

| A accepté

Réponse apportée
Quadratic spline having shape preserving property
You cannot define a shape preserving quadratic spline that is differentiable across the breaks. So while you think you want it,...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How to optimize the solution of one optimization function using another?
Why do you think this has any remote reason to converge? Consider this trivial example of a pair of problems, based exactly on t...

environ 4 ans il y a | 0

Réponse apportée
reading the numbers resulting from the loop
Why would it mean anything else? That is, what is the product of the numbers 10^4*2.2567? 10^4* 2.2567

environ 4 ans il y a | 0

Réponse apportée
What to do when solving a system with a sparse matrix and a dense matrix results in a singular matrix, even after normalization?
Normalizing the matrix in some way will not help. In fact, it might invalidate the FEM solution, depending on what you did. Sinc...

environ 4 ans il y a | 2

| A accepté

Réponse apportée
Plot figure for f(y,z)=0
Simple enough. Define the two functions. Then subtract them, and plot using fimplicit. f = @(z) 0.07*z.^2./(0.09 + z.^2); g = ...

environ 4 ans il y a | 1

Réponse apportée
Formulate an objective function with summation terms to solve a linear programming problem
Why would you need fmincon on a purely linear problem? u and v may be different vectors in your eyes, but they can trivially b...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Solve differential equation from Matlab
Making various assumptions, we see the solution as: syms ka kd C xmax syms x(t) dsolve(diff(x) == (ka*C*(xmax-x)-kd*x)/(1+ka*...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Obtaining the combinations of a vector array to satisfy lineal constrains.
Is it possible? Of course. Exhaustive enumeration. Just try all combinations, saving those that work. Is that easy? OF COURSE NO...

environ 4 ans il y a | 0

Réponse apportée
Random number generation with min, max and mean
Sigh. I've probably seen different variations of this question asked at least many hundreds of times over the 40+ years I have b...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
fit tool with errors in x and y
You can't. Period. You cannot use fit to solve a problem with errors in both x and y. That does not say the problam is never sol...

environ 4 ans il y a | 1

Réponse apportée
roots(x) vs root= interp1(y,x,0)
You need to understand the mathematics. Lost you will be without that (to misquote someone named Yoda.) For this polynomial: s...

environ 4 ans il y a | 0

Réponse apportée
How to create random matrix with specified step in interval [a, b]
You can also use indexing. The idea is to generate random indexes. ValidRandomSet = 5:3:34 m = 7; n = 6; ind = randi(numel(V...

environ 4 ans il y a | 2

Réponse apportée
Interpolate using a different method without the original image
Um, no, or, yes. Anyway, you cannot do it directly. And it may be completely impossible to do. All of that depends on several th...

environ 4 ans il y a | 0

Réponse apportée
How to find the volume of cross-sectional area of a cylinder
Is there a ready made function that will do the mathematics for you, based only on an inequality? No. You will need to do some m...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Error solving bvp4c - Singular jacobian
You have a simple classical ODE, with two INITIAL conditions, not boundary conditions at different ends. So use a tool like ODE4...

environ 4 ans il y a | 0

Réponse apportée
noisy plot after calculating first derivative
You should recognize that differentiation is a noise amplification operator. So any small amounts of noise in your signal, even ...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
fminsearch with side conditions
Generally, the solution is to not use fminsearch. Use a better optimizer instead. It will be faster, and you will get a better a...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Obtaining value of highest order derivative over simulation period
Can you use schemes like ODE45, combined with gradient to compute exact estimates of the high order derivatives? Sadly, no. High...

environ 4 ans il y a | 1

Réponse apportée
Acceleration at the center of the triangle
If you have some known parameter at the three corners of a triangle, then the best estimator of that parameter at the center of ...

environ 4 ans il y a | 1

Réponse apportée
How to use bitn
You cannot define a scalar variable as a binary one with an arbitrary number of bits. You can define integer variables, with a s...

environ 4 ans il y a | 0

Réponse apportée
Why I'm getting error (too many arguments) in my integral
You need to pay MUCH more attention to your code. For example, just a quick look shows this: Intdoble6=int(int(2*y^2,x,0,1)4*x...

environ 4 ans il y a | 0

Réponse apportée
I nee to write a code to solve a definite integral. The output format has to be fprintf.
Do you understand that MATLAB REQUIRES a multiplication operator? You cannot just put a number next to a letter, and expect MATL...

environ 4 ans il y a | 1

Réponse apportée
Maximum Likelihood Estimation function
Is there another way? Why not negate the function, and then use a tool like fminbnd? Or fminsearch. Or fmincon or fminunc, or .....

environ 4 ans il y a | 0

Réponse apportée
What optimizer should I use?
This is not a problem of finding an optimizer. This is a problem of understanding how to formulate a problem so that it is possi...

environ 4 ans il y a | 0

Réponse apportée
simulation stopped because of step size tolerance and constraints
Let me see. You posed an optimization problem. The solver returned a result, one that SATISFIES the tolerances you posed. You we...

environ 4 ans il y a | 0

Charger plus