Réponse apportée
Why is sec(theta) different than sqrt(1+tan(theta).^2) in MATLAB?
First, what you have written is NOT an identity. The identity is sec(theta)^2 = 1 + tan(theta)^2 There IS a difference! Y...

plus de 4 ans il y a | 1

Réponse apportée
Why does MATLAB give an error with this instruction? x(0.14*100)=5;
Is there a bug in MATLAB? Sigh. If I had a nickel for every time someone has asked that question, I would be wealthy. (It does n...

plus de 4 ans il y a | 2

| A accepté

Réponse apportée
Linprog gives a solution but one constraint is not satisfied (no notification)
Not possible to know, since you don't actually show us the code you wrote. You may have done something wrong. Or it may just be...

plus de 4 ans il y a | 1

Réponse apportée
make a data plot
Easier than you think. First, write a little function that will plot a bar of fixed height, between two points on the x axis. I...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Multiplication of large matrix with its transpose
Best is to never create it at all. Instead, use mathematics to work with it. And that depends on what you will do with this matr...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Forcing positive values when solving system of linear equations
Sorry. PINV does not allow you to constrain the sign of your estimates. You can use LSQNONNEG, which does allow you to do that,...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How can I convert the shape of one class to another using Matlab?
All you have is a picture, not a shape. Until you express those boundaries as a shape of some sort, you cannot do anything. Sin...

plus de 4 ans il y a | 0

Réponse apportée
Solving ODE with non-constant parameters using ode45
Trivial. In fact, there are many ways I could do this. As an example, i'll define it in terms of three other parameters, S,u an...

plus de 4 ans il y a | 0

Réponse apportée
Matlab function deprecates its inputs
Your function is copied below. Answers actually uses R2021b, so we can test your assertion here. param_init('ExternalSubject') ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
why does 'sum' and 'trapz' function show same result ?
Um, no. Sum is not the same as trapz. Are they close, under some circumstances? Well, yes. format long g sum(B) ans = 591258...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How to obtain union of three shapes given the coordinates
Tivial. generate the three objects as polyshapes. Compute the union. For example... cy_l=0.3; % length of rectangle outside...

plus de 4 ans il y a | 0

Réponse apportée
How to get the source code of a function
If the function is compiled, then no. Sorry, but no. MathWorks does not give out code, unless you work for them. So sure, just g...

plus de 4 ans il y a | 1

Réponse apportée
Contour plot of x and y
Since you have not (yet) shown me any data or answered my questions, I'll offer one simple solution, just making guesses about t...

plus de 4 ans il y a | 0

Réponse apportée
Contour plot of x and y
I'm not sure what you mean. A contour plot is a specific type of plot. A contour is a level surface, that is, the set of points...

plus de 4 ans il y a | 0

Réponse apportée
How to resolve problem in for loop?
Is "a" a number, in the form MATLAB will expect it? NO! a is a BigInteger number. You cannot use the colon operator on a. a=jav...

plus de 4 ans il y a | 1

Réponse apportée
Find unique values in a pseudo inverse based on SVD
Um, in general, ALL of the values in the computation will be non-unique. In some simple, RARE cases, that will not be true. How ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Multiplication on the diagonal of a submatrix
You really want to learn better ways to time things than to use tic and toc. They are not very accurate for short times. Not too...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Iteratively defining and solving equations
It is a LINEAR system of equations. You don't want to be solving them iteratively. You need to learn how to define the matrix th...

plus de 4 ans il y a | 0

Réponse apportée
How to generate two random where the distance between is within a range
Can you "say" that? Um, yes. But then you need to write the code. Given one known point, now you want to find another randomly ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
how do i integrate one vector by using "intergral function" and not trapz ?
You cannot use the intergral function, as it does not exist. You could use integral, almost. :) Except that it does not apply to...

plus de 4 ans il y a | 0

Réponse apportée
how to get the argument and the modulus of a analytic complex function?
The use of mod as the name of a variable is a REALLY bad idea. Soon, when you begin using MATLAB more, you will trip over things...

plus de 4 ans il y a | 0

Réponse apportée
unrecognized functions or variable
You don't import a function into MATLAB. Perhaps you are thinking Python, or some similar environment. It looks like onehotenco...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Fit power function to data (optimization)
Your problem is, you are trying to use LEAST squares. But look carefully at your data. xdata = [0.02 0.05 0.1 0.2 0.3 0.4 0.5];...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
need help with this my fsolve is not working
You were close. And I think what you did wrong was not completely obvious. Your function is below. First, BEFORE YOU EVER TRY t...

plus de 4 ans il y a | 2

| A accepté

Réponse apportée
How to rearrange an equation in matlab to get the poles?
Vs = 1; Z0 = 50; R = 50; C = 1e-9; L = 0; syms s %Where s = j*w %Impedance of the resistor ZR = R; %Impedance of the ca...

plus de 4 ans il y a | 0

Réponse apportée
How to find baseline intensity in noisy mass spectra?
First, define baseline. Is it the lowest value the signal does not drop below? If so, then the baseline is trivial to estimate. ...

plus de 4 ans il y a | 0

Réponse apportée
Integration of a function
Integral is a NUMERICAL tool for integration, uing adaptive numerical methods. It will return a NUMERICAL result, and only appli...

plus de 4 ans il y a | 0

Réponse apportée
Best choice of fmincon algorithm for high-cost 1D convex problem with "stochastic" gradient information?
A 1-d problem, so ONE unknown? Don't use fmincon at all! And if you wish to supply the gradient, then you cannot supply only a...

plus de 4 ans il y a | 0

Réponse apportée
Feature Request: Set Logarithmic axes in the 'Distribution Fitter' tool
Answers is NOT the place to submit feature requests. We are not customer support. We are not any kind of official support. If y...

plus de 4 ans il y a | 0

Réponse apportée
Optimize two variables under two conditions
Um, you cannot optimize TWO things at once. There is no reason to assume that they will both achieve their respective optimal ...

plus de 4 ans il y a | 0

| A accepté

Charger plus