Answered
code for simultaneous sound recording and playing
I would highly recommend reading and browsing through some of the demos in the DAQ toolbox. demo toolbox 'data acquisitio...

14 years ago | 0

Answered
vectorize lsqnonneg?
preallocate nnCoeff so that it doesn't change size on each iteration. nnCoeff = zeros(nRedTACs,nPixels); for k ... nn...

14 years ago | 0

Answered
evaluate diameter of moving bubbles
doc regionprops to find the center.

14 years ago | 0

Answered
histogram, indices of values used from the vector for each class?
accumarray(c1,c2,[],@std) I have it running about 3x faster than |grpstats| too: c1 = [ 1 3 2 1 3 1 2 2 3 3 2 2 ]'; c2 =...

14 years ago | 0

Answered
Positive definite solution
Use a second variable and only update it if the eigenvalues are all positive. When you exit the loop it will be the last set of...

14 years ago | 1

Answered
Help with Matlab homework question
I answered the exact same homework question here: <http://www.mathworks.com/matlabcentral/answers/17715-loops-to-define-a-mat...

14 years ago | 0

Answered
Fast method to store workspace variables into another worspace variable?
You could pass them into the function the typical way function y = some_fun(tmp,x) y = x*tmp; Or you can use setappda...

14 years ago | 0

Answered
Efficient code writing...
A well written for-loop should be pretty fast. I would recommend doing that. make sure to preallocate your matrix of transform...

14 years ago | 0

Answered
interpolating in 3 dimension for each cell position
It looks as though John's inpaint_nans3 has been removed from the FEX. It's what I would've recommended to start with. Perhaps...

14 years ago | 0

Answered
adding matrices inside a big matrix
And this fun answer: sum4x4 = reshape(sum(reshape(reshape(sum(reshape(B,4,[])),size(B,1)/4,[])',4,[])),size(B)./4); sum4x4 =...

14 years ago | 2

| accepted

Answered
GUI operations on matlab objects (non-GUI)
And there's always get/setappdata: doc setappdata doc getappdata

14 years ago | 0

Answered
adding matrices inside a big matrix
How about blkproc if you have the Image Processing Toolbox (or blockproc in newer versions). blkproc(magic(16),[4 4], @(x)(su...

14 years ago | 1

Answered
Image Processing
for easy automatic hdr/img reading: doc analyze75read %and friends

14 years ago | 1

Answered
fsolve with cell input?
Using |num2cell| if you're only concatenating along one dimension is significantly faster. E.g: A = magic(1000); t1 = 0;...

15 years ago | 0

Answered
Left matrix multiplication giving wrong answer (off by 0.125)
rank(A) % ans = 2 shows that there are only two linearly independent rows of A, it ideally would be 3 for a 3x3 matrix. ...

15 years ago | 0

| accepted

Answered
problem with eval notation
I don't see any reason for eval above. If you get rid of it, it should still run. If you're required by law of the professor t...

15 years ago | 0

| accepted

Answered
MATLAB is missing one essential rounding function!
function out = rafz(in) %out = rafz(in), round away from zero %SCd 10/26/2011 % out = max(abs(ceil(in)),abs(floor(in))).*...

15 years ago | 2

Answered
Normalized Correlation
Looks almost right to me, does it look right to you? Hint: you need to change A to M in the assignment to row. Okay, that wa...

15 years ago | 0

| accepted

Answered
How to make .jpg file two-dimensional?
class(A) will return 'uint8' (most likely). Calling 'bw'areaopen will want a black and white logical image. This is dange...

15 years ago | 1

Answered
finding coordinates through distance formulation
I'd say the formula for a line is a good place to start. Please give us more detail so we have something to work with. Do you ...

15 years ago | 0

Answered
Visualization Technique
fill3([50 50 50 50],[0 100 100 0],[0 0 100 100],'b') ?

15 years ago | 0

Answered
Second Order Differential Equation with boundary conditions not at zero
Sounds like you want |bvp4c| doc bvp4c

15 years ago | 0

Answered
Help with dynamic GUI interface
Yes, it can be done with a GUI. These might be resourceful to you: <http://www.mathworks.com/matlabcentral/fileexchange/24861-...

15 years ago | 0

| accepted

Answered
how to get image position in a figure, for annotation purpose
|Set| the figure 'units' to 'pixels' and then |ginput| will correspond directly.

15 years ago | 0

Answered
Problems with intersect function
A fix: X(all(abs(bsxfun(@minus,X,point))<(10^-10),2),:) Row with both absolute differences less than tolerance. Will only ...

15 years ago | 1

Answered
Convert a matrix in the workspace into Excel in GUI
Well I would recommend looking at: guide to develop your GUI, and |xlswrite| to develop your excel export.

15 years ago | 0

Answered
Finding Peaks
I'll just put in my vote *AGAINST* taking the derivative of noisy data - especially three of 'em. Derivatives of noise amplify n...

15 years ago | 0

Answered
Indexing of cell array using cellfun
C = mat2cell(rand(100,2),ones(1,10)*10,2); V = randperm(10).'; out = cellfun(@(c,idx)c(idx,:),C,num2cell(V)) perhaps?

15 years ago | 1

Answered
Time difference between two sets of times in hrs mins and seconds.. GUI if possible
So start by opening GUIDE guide %at the command line Then draw the GUI so that it has edit boxes to enter times, static ...

15 years ago | 1

Answered
Can not plot, please help
It is plotting, it's just only plotting a single point. The matrix division of a 1x11 vector by a 1x11 vector is a scalar. ...

15 years ago | 0

| accepted

Load more