已回答
Plotting heaviside unit step functions
If you replace the line with the heavisides in it with the one from my previous answer dydt(2) = (A*t >= 0) + 4*(A*(t-1) >=...

13 years 前 | 1

| 已接受

已回答
Plotting heaviside unit step functions
heaviside is a function from the symbolic toolbox - I'd be surprised your code doesn't complain when you try to call it. Why ...

13 years 前 | 0

已回答
Economical use of memory
Matlab's semantics are pass-by-value but it only actually copies the matrix if you modify it within your function, "lazy copy" o...

13 years 前 | 0

已回答
Why do you come to "MATLAB Answers"?
When I get blocked with my research, here at least I can make an epsilon contribution to something ...

13 years 前 | 1

已回答
Why not use square brackets?
OK, I looked into this a little more rigorously. I thought I'd test James Tursa's suggestion from my previous answer to see if t...

13 years 前 | 3

已回答
Why not use square brackets?
A quick test reveals that there is a small cost to including them tic for i = 1:1000000 A = [1:100]; end t1...

13 years 前 | 1

已回答
??? Subscript indices must either be real positive integers or logicals. Using findpeaks
You've probably declared a variable called findpeaks by accident. Try which findpeaks and confirm it's actually pointin...

13 years 前 | 1

已回答
MATLAB in unexpected places
On an episode of Harry's law (I can't remember which one), Tommy Jefferson (a fast-talking lawyer) boasts about a number of laws...

13 years 前 | 0

已回答
matlab function
Why not just [M, N] = find(I, 1, 'first') ?

13 years 前 | 0

已回答
Surface area from a z-matrix
If your data is smooth enough (assuming that's what you're after), then there is a really quick way to work out approximately th...

13 years 前 | 1

已回答
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

| 已接受

加载更多