已回答
Need help with newton's theorem (matlab)
It works fine - you're just using a (contrived!) nasty example. Plot your function between -3 and 20 and see where the first New...

13 years 前 | 1

| 已接受

已回答
Lagrange Multipliers
This is not a Matlab question, it's a calculus homework problem. Define a function f(x,y) that you want to minimise, a constrain...

13 years 前 | 0

已回答
data fitting starting from a coupled system of differential equations
Hi Simona. I'm adding this as a new answer so that I can use code markup. You need a function that takes in K1, K2, K3 as inputs...

13 years 前 | 0

已回答
plotting unit step function
Or as an anonymous function: f = @(t) (t > 1) - (t > 2) + (t < 2) - (t < 3) + (t > 3) - (t > 4); t = linspace(-5, 5, 200...

13 years 前 | 0

已回答
How to create a solid spherical cluster with random distribution of points
Here's the lazy (no thinking, no maths) way. It will be slow(ish), but serves to illustrate the idea. I'm sure you can think up ...

13 years 前 | 1

已回答
Handles: How do They Work?
The easiest way to do this is to define a constructor function that passes out a handle to be used in the ode solver by using ne...

13 years 前 | 0

| 已接受

已回答
Max / Min of sparse matrices
*EDIT* There was a mistake in the markers line and the s= line, fixed now. OK, here's an accelerated version. What made my pr...

13 years 前 | 1

| 已接受

已回答
Max / Min of sparse matrices
Can't do this one quite so cutely :) Try this (for rows), you can do the same thing for columns with a trivial modification ...

13 years 前 | 0

已回答
Can I use quadprog when equality constraint matrix is not full rank?
If your equality constraint matrix is not full rank, then either your equality constraints are consistent, and dependent, or the...

13 years 前 | 0

| 已接受

已回答
Max/Min of nonzero rows/cols
B = A; B(B == 0) = NaN; colMax = max(B); colMin = min(B); rowMax = max(B, [], 2); rowMin = min(B, [], 2); ...

13 years 前 | 2

| 已接受

已回答
cell comparison with other cells in different rows
For the record, it would be better to use arrays rather than cell arrays for the coordinates (in fact for the whole thing, but t...

13 years 前 | 0

| 已接受

已回答
Non negligeable imaginary number after ifft even when hermitian symmetry is kept.
When you do your flipdim, shouldn't you be taking the complex conjugate also?

13 years 前 | 1

已回答
Find element in matrix
Here's a slightly uglier way that will work. If you need the code to perform quickly, you'd obviously preallocate your arrays m ...

13 years 前 | 1

| 已接受

已回答
sum of series
I think you may need to try and ask your question more clearly. What you've written there reduces to 1 + 2 + 3 + ... If it's ...

13 years 前 | 0

已回答
maximum position of element in a matrix
Pretty straightforward - the only complicating factor is that max only works down one dimension at a time, so you either have to...

13 years 前 | 0

| 已接受

已回答
handles to subfunctions?
From <http://www.mathworks.com/help/techdoc/matlab_env/f9-6232.html> The report does not list: ... Files called from ...

13 years 前 | 2

已回答
How to control number of threads in FFT ?
I just tried it out on my Windows install (R2011b). No matter what you set maxNumCompThreads to, fftn only ever uses one thread....

13 years 前 | 0

已回答
robot
<http://petercorke.com/Robotics_Toolbox.html>

13 years 前 | 1

已回答
Get Feature from an image and match it from another image
There are lots of algorithms that do this. Try google for * SIFT * SUSAN * NCC * Harris etc. etc. There are many Matla...

13 years 前 | 0

已回答
Affine transformation that takes a given, known ellipse and maps it to a circle with diameter equal to the major axis.
I'm writing this down as a new answer so I can get markup for the code snippets. Let's work with the first blob from regionprops...

13 years 前 | 3

| 已接受

已回答
Faster way for all possible arrangements
If you want to use native Matlab looping, but keep the benefit of flexibility (different n or k), then you can unroll the loops:...

13 years 前 | 0

已回答
Affine transformation that takes a given, known ellipse and maps it to a circle with diameter equal to the major axis.
Not difficult to do, but a bit fiddly. Exactly how difficult depends on the form of your known ellipse equation. I'm going to as...

13 years 前 | 0

已回答
remove row with matching string
If it can occur anywhere, use cellfun to test for equality: [I, ~] = find(cellfun(@(s) isequal(s, 'waiting'), myarray)); ...

13 years 前 | 0

已回答
Faster way for all possible arrangements
What you are currently doing is probably pretty close to optimal using native Matlab code. Depending on what you are doing you m...

13 years 前 | 0

已回答
computing issue
You need to decide how to represent the f_i and f - whether by functions or by vectors (the function evaluated on some mesh). ...

13 years 前 | 0

已回答
Improved Euler Method with embedded error estimate and variable time step
you could include a while loop inside your inner loop that's loosely like this: e_norm = inf; while e_norm > E_max ...

13 years 前 | 0

| 已接受

已回答
data fitting starting from a coupled system of differential equations
You're not going to be able to use a curve-fitting tool to find your parameters, you're solving an optimisation problem. Essenti...

13 years 前 | 0

| 已接受