Answered
Additive Dynamic Plotting
This is an example of where the plots add on top of each other: xD = 100*randn(1,1000); yD = 100*randn(1,1000); [...

15 years ago | 1

| accepted

Answered
Repair non-Positive Definite Correlation Matrix
I guess it really depends on what you mean by "minimal impact" to the original matrix. *Idea 1:* This is probably not optimal ...

15 years ago | 1

Answered
plot a 3-d figure (rhombus inside a cricle)
Just solve Laplace's equation: Uxx + Uyy = 0. This makes the plot you have shown. Doing it with a rhombus instead of a square...

15 years ago | 1

| accepted

Answered
Ignoring NaN values when multiplying?
"The only way i come to think of would be to change the NaN-values to 1" That sounds like a reasonable idea to me: X = [...

15 years ago | 0

Answered
Plot - move data on top
Use uistack figure h(1) = plot([1 0 1 0 1],'r','linewidth',20); hold on; h(2) = plot([0 1 0 1 0],'b','linewidth',20);...

15 years ago | 4

Answered
Efficient way to fill vector values from another vector
Sometimes the answer is simpler than you think: retTargets = inputSignal.*inputTargets; for n = numel(retTargets)-1:-1:1...

15 years ago | 1

| accepted

Answered
Perspective transform a Point not an Image
If you have the Image Processing Toolbox, using *cp2tform* and *tformfwd* makes this very easy, and will work even when ImagePoi...

15 years ago | 1

| accepted

Answered
Plot of data representing particles of various size and various properties (e.g. temperature)
I think the downside with using SCATTER is that the marker doesn't change size with zooming. Using PATCH might be another option...

15 years ago | 0

Answered
Nested for-loops too slow
You really shouldn't use "sum" as a variable name. That is the name of a very useful built-in function. I'll call your variable ...

15 years ago | 2

Answered
Speed up a "logical matrix multiply"
C = full(double(sparse(A))*sparse(B) > 0);

15 years ago | 1

Answered
using contour()
Say your mean is m, and your covariance is S. m = [1 2]; S = [2 1; 1 10]; *The easy way:* If you have the statistics...

15 years ago | 0

| accepted

Answered
Array manipulation?
This should be simple enough. Obviously the first element can't be a nan though. PP = PPP; for n = 1:numel(PP) i...

15 years ago | 0

Answered
How to replace zeros with other value in a big matrix fast
Matt, I had originally thought the same thing (using a colon on the right hand side also might be faster), but I'm not able to r...

15 years ago | 0

Answered
Norm of the difference of each row of two matrices of different dimensions
What's wrong with BSXFUN here? for pix = 1:npixels dist = sum(bsxfun(@minus,means,yClustered(pix, 1:end-1)).^2,2);...

15 years ago | 0

Answered
Matlab function "mean" returns the exact same value for "uint16" and "double" values, not for single values
Expanding on Andreas's answer a little bit, For single precision, the consecutive integers are available only until 2^24 (16777...

15 years ago | 1

| accepted

Answered
Vectorize a per-pixel classification
The key is recognizing that: diag(R*A*R') == sum(R*A.*R,2); Try the following code. It does exactly what your code does, u...

15 years ago | 0

| accepted

Answered
How to use rotatable 3D mesh graphs in presentation
Option 1: Start MATLAB up during your presentation. (If you could do this, you probably wouldn't be asking this question) Opt...

15 years ago | 0

Answered
Time difference between two curves
If all you really want to know is what the difference between the curves is, then one way would be to use kind of a reverse look...

15 years ago | 0

Answered
Plotting solutions of a for loop involving matrices.. Need to plot at each time step.
Make B a 12x360 matrix where you store the result at each time step: % Don't mind this, just making a random A matrix... A ...

15 years ago | 0

| accepted

Answered
Image Processing ( calculate perimeter)
Use the REGIONPROPS function. I = peaks(500) > 3; imshow(I); P = regionprops(I,'perimeter'); P.Perimeter

15 years ago | 0

Answered
Solving an ODE with best-fit adjustment to empirical observations
If I understood correctly, you want to find the parameters for an ODE such that the ODE fits some experimental data. If you have...

15 years ago | 0

| accepted

Answered
Imagesc/Contourf and plotting correctly
This is just a guess, but depending on how you found your minimum locations, the x and y values (mini(2) and mini(3)) might be r...

15 years ago | 0

Answered
Sort a cell array of char
Instead of just "double" you should use "str2double". I'm pretty sure that does what you want. A = {'1001', '112', '14'} B ...

15 years ago | 0

Answered
inverse laplace and more and more and more
The length of the variables only needs to match on the 2nd and 3rd inputs because that is where you are defining the input x(t) ...

15 years ago | 0

Answered
inverse laplace and more and more and more
Do you have the Control Systems Toolbox? I think this entire problem would be much easier if you used that instead of symbolic v...

15 years ago | 0

| accepted

Answered
data manipulation
This is not so hard, and is a nice example of why MATLAB is so great for working with arrays. % I'll make a random 143x143x14...

15 years ago | 0

| accepted

Answered
Random numbers without repetition
This is a simple (but inefficent) way to do it using UNIQUE: Y = []; while size(Y,1) ~= 3 Y = unique([Y ; randsample(10...

15 years ago | 0

| accepted

Answered
Get a GUI to update while a loop is running
Instead of having this %obtains the slider value from the slider component handles.temporalFiltWeight = get(handles.tem...

15 years ago | 2

| accepted

Answered
editing a nyquist figure
Run the nyquist command as usual: nyquist([1],[1 2 1]) Then if you right click on the axes (the white part), a context m...

15 years ago | 4

| accepted

Load more