Beantwortet
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) >=...

etwa 14 Jahre vor | 1

| akzeptiert

Beantwortet
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 ...

etwa 14 Jahre vor | 0

Beantwortet
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...

etwa 14 Jahre vor | 0

Beantwortet
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 ...

etwa 14 Jahre vor | 1

Beantwortet
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...

etwa 14 Jahre vor | 3

Beantwortet
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...

etwa 14 Jahre vor | 1

Beantwortet
??? 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...

etwa 14 Jahre vor | 1

Beantwortet
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...

etwa 14 Jahre vor | 0

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

etwa 14 Jahre vor | 0

Beantwortet
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...

etwa 14 Jahre vor | 1

Beantwortet
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...

etwa 14 Jahre vor | 1

| akzeptiert

Beantwortet
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...

etwa 14 Jahre vor | 0

Beantwortet
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...

etwa 14 Jahre vor | 0

Beantwortet
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...

etwa 14 Jahre vor | 0

Beantwortet
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 ...

etwa 14 Jahre vor | 1

Beantwortet
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...

etwa 14 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 14 Jahre vor | 1

| akzeptiert

Beantwortet
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 ...

etwa 14 Jahre vor | 0

Beantwortet
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...

etwa 14 Jahre vor | 0

| akzeptiert

Beantwortet
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); ...

etwa 14 Jahre vor | 2

| akzeptiert

Beantwortet
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...

etwa 14 Jahre vor | 0

| akzeptiert

Beantwortet
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?

etwa 14 Jahre vor | 1

Beantwortet
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 ...

etwa 14 Jahre vor | 1

| akzeptiert

Beantwortet
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 ...

etwa 14 Jahre vor | 0

Beantwortet
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...

etwa 14 Jahre vor | 0

| akzeptiert

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

etwa 14 Jahre vor | 2

Beantwortet
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....

etwa 14 Jahre vor | 0

Beantwortet
robot
<http://petercorke.com/Robotics_Toolbox.html>

etwa 14 Jahre vor | 1

Beantwortet
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...

etwa 14 Jahre vor | 0

Beantwortet
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...

etwa 14 Jahre vor | 3

| akzeptiert

Mehr laden