Answered
Matlab integration of numerical data
In order for it to be truly general, you will need to interpolate the "function". For example, we might do this: x = 0:10; y =...

5 years ago | 0

Answered
How to select complementary elements from a vector?
d = [3 2 1 5 6 7 8 9 0]; I = [1 3 7]; setdiff(d,I) Note that your example is actually incorrect, in that you claim 7 should...

5 years ago | 0

Answered
Applying Newton's Method to Sound Level Equation
Since we cannot solve it directly.... Are you absolutely positive of that? L0 = 80; beta = 32.2; L = 20; syms r solve(L0...

5 years ago | 0

Answered
Output all possible results on a 7 equation system
First, it can be proven that not all mathematical equations of this sort can be "solved". This goes back as far as Abel-Ruffini....

5 years ago | 1

| accepted

Answered
solving equations with trigonometric functions
Note that x1, x2, x5, x6 are just NUMBERS. Defining them as syms in advance does nothing. MATLAB is a language with dynamic vari...

5 years ago | 2

| accepted

Answered
error in matrix multiplication while solving system of differential equations
What you do not understand is that the exponential function is exp. Thus, instead of writing e^(-t), you write exp(-t). Next, y...

5 years ago | 0

Answered
How to solve an optimization problem over two variables using fmincon?
You CANNOT use fmincon on a problem with binary variables or any form of discrete variables. However, IF y is indeed binary, th...

5 years ago | 0

Answered
Equation to Matlab code
ALWAYS show what you wrote. Ony you know what you mean by dealing with vectors, etc. In the first case, do you have a vector of ...

5 years ago | 0

| accepted

Answered
How to calculate partial area-under-the-curve?
After all of those comments, to be honest, sorry, but you were both working far too hard on a moderately simple problem. Simpl...

5 years ago | 0

Answered
How to call fminsearch on my function
Um, you misunderstand the problem. Your function has TWO arguments. PR and PC, both of which you want to be optimized. And while...

5 years ago | 0

Answered
Uniform Random Variable PDF
What are you doing wrong? Um, pretty much everything? Sorry, but true. ;) However, you do seem to have made some credible effort...

5 years ago | 0

Answered
Solving Exponencial fuction is not returning the right answer
Yes, you THINK the true answer is 3. But it is not. format long g log(2653/2500) / log(51/50) And that is effectively the exa...

5 years ago | 1

| accepted

Answered
Solving an inequation of first degree issue
syms x a = 3*x + 21 <= 5*x + 13 asol = solve(a,'returnconditions',true) asol.x asol.conditions It looks like x >= 4 is the ...

5 years ago | 1

| accepted

Answered
datetime values appear to be equal but return not equal
format long does NOT tell you every single digit in the number!!!! format long does NOT tell you every single digit in the numb...

5 years ago | 0

| accepted

Answered
Distribute data in the form of a circle
You say you want to distribute data, which implies you want to see random numbers, based on some vague, unspecified distribution...

5 years ago | 0

| accepted

Answered
Cody Problem 19. Swap the first and last columns
This is NOT a provblem with the Cody problem, but with your code to solve it. First, see what happens when A is 1. I'll show wh...

5 years ago | 0

| accepted

Answered
How I can separate a matrix that is not positive definite, into two matrices?
Please learn to use operators and to clearly explain your question. Are you asking to find a new matrix Sq, such that the linea...

5 years ago | 0

Answered
Search for combination of parameters that make minimum function output.
Before you go too far, some ideas to consider. I hope you have a FUNCTION, not a script. Learn to use functions. You will need...

5 years ago | 0

Answered
Interpolating non-independent values
x is non-monotonic as a function of time. I have no idea what you mean by bounce, but I assume it indicates the failure to be mo...

5 years ago | 1

Answered
Is not there a way to erase all the NaNs from a mxn matrix once and left the index values empty ?
A matrix cannot have "empty" elements. Well, a cell array can, or if you wrote a completely new class of your own, but standard ...

5 years ago | 1

| accepted

Answered
Can't solve for x with (a = y/x)
I'm not sure what a rational integer is. How is that distinct from an integer? Anyway, assume x and y are integers, with a comp...

5 years ago | 0

Answered
How can I use while loops to determine if an element is larger than the element below it and store the results in a vector with 1 representing true and 0 representing false?
"While" this does not answer your question, I would not use a while loop at all. Learn to use MATLAB as it is designed. A = ran...

5 years ago | 2

Answered
Function after spline fitting
You cannot extract any "function" from a spline. At least, if you did, it would not be anything you could read or type without m...

5 years ago | 0

Answered
How to extrapolate a curve using a data set?
Ah, if people were able to accurately and easily extrapolate data, then everyone would agree about things like global warming. O...

5 years ago | 2

Answered
Solving a first order ODE with dsolve
While you may THINK that is the only answer, is it true that y==0 is also a solution? How about the constant value of sqrt(2)? ...

5 years ago | 0

| accepted

Answered
does pp.breaks represent the arc length ?
NO. Not even remotely close to the arc length for a standard spline, perhaps something computed using the function spline. Alth...

5 years ago | 0

Answered
How to efficiently solve a matrix eqation when the matrix is updated?
The problem is, it very much depends. If you can write the change in A as a rank 1 update, AND you write the code well, then you...

5 years ago | 0

Answered
2d plot of a non-linear equation
Walter has already told you how to plot it. But so you can learn how to find that for yourself, learn to use lookfor. The trick...

5 years ago | 0

Answered
Basins of attraction and Newtons Method
Since this is clearly homework, and we don't do homework for people on this site, think about it! First, you almost always want...

5 years ago | 0

Answered
Multiple Equations in Matlab Solver
No. You have ONE equation. It just happens that you defined it in 4 pieces, then you added them all up. If you defined them as ...

5 years ago | 0

Load more