回答済み
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) >=...

約14年 前 | 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 ...

約14年 前 | 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...

約14年 前 | 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 ...

約14年 前 | 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...

約14年 前 | 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...

約14年 前 | 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...

約14年 前 | 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...

約14年 前 | 0

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

約14年 前 | 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...

約14年 前 | 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...

約14年 前 | 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...

約14年 前 | 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...

約14年 前 | 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...

約14年 前 | 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 ...

約14年 前 | 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...

約14年 前 | 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...

約14年 前 | 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 ...

約14年 前 | 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...

約14年 前 | 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); ...

約14年 前 | 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...

約14年 前 | 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?

約14年 前 | 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 ...

約14年 前 | 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 ...

約14年 前 | 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...

約14年 前 | 0

| 採用済み

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

約14年 前 | 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....

約14年 前 | 0

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

約14年 前 | 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...

約14年 前 | 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...

約14年 前 | 3

| 採用済み

さらに読み込む