Answered
Stop Excuting some lines
flag = 1; while <condition> <commands to be always executed> if flag <commands to be executed only on fir...

14 years ago | 1

| accepted

Answered
plotting 2 points
If you have the Image Processing Toolbox, have a look at the edge() function. The associated demos will give you examples that y...

14 years ago | 0

Answered
Vector Error
A call to fread returns a vector, but you can only store a single number in y(i) if i is a scalar (which it is in your code - i ...

14 years ago | 0

Answered
Display pairs of random images from a file
Something based on this should work (not tested): dfiles = d(~[d.isdir]); N = length(dfiles); genRandNum = randperm(N...

14 years ago | 1

Answered
try&erorr
You need to carry out some computation that changes the value of FS or of FS1 inside the loop. Perhaps that computation depends ...

14 years ago | 0

Answered
how to remove empty cell array contents?
Rnew = R(~cellfun(@isempty, R))

14 years ago | 10

Answered
subsampling
If you have the Image Processing Toolbox, you can subsample with the *imresize* function.

14 years ago | 0

Answered
Best reason to replace structures with classes
I find OOP helpful in a situation where I'm computing something that depends on lots of different inputs - parameters, data, opt...

14 years ago | 2

| accepted

Answered
Loren's blog: Best programming practice
Yes!

14 years ago | 1

Answered
calculation of mean , standard deviation and average for each pixel in an image M*N?
To get the means, you can do means = conv2(Image, ones(31)/(31*31), 'valid'); Note that means(1,1) is the mean for the ...

14 years ago | 0

Answered
NaN when calculating average
Although a NaN is not a number, it is of class double, and so it is numeric. If a NaN was not numeric, it could not be held in a...

14 years ago | 1

| accepted

Answered
Curl of Gaussian image derivatives
Note that if you take the cross-product of 2 vectors in the plane, only the Z-component of the result is non-zero. The follow...

14 years ago | 0

Answered
Joining/merging several cell arrays
The standard concatenation brackets work with cell arrays just as with numerical arrays: >> cell1 = {'a' 'b' 'c'}; >> cell...

14 years ago | 0

Answered
Gradient computation
You could use <http://www.mathworks.co.uk/help/techdoc/ref/gradient.html gradient(y)>, provided that it's always the case that x...

14 years ago | 0

| accepted

Answered
Generate random (biased) points lying on two circumferences
How about something based on this: n = 500; angles = 2*pi*rand(1,n); r1 = 0.5 + 0.01 * randn(1,n/2); r2 = 1 + 0.02...

14 years ago | 0

| accepted

Answered
how to de concatenate in matlab?
Use indexing. a = [1 2 3]; b = [4 5 6]; c = horzcat(a, b); % [EDITED]: horcat->horzcat anew = c(1:3); bnew =...

14 years ago | 0

Answered
linspace
If you concatenate the vectors y, y1 etc. the integer elements will be repeats. That is, it will go [1 1.0028 ... 1.9972 2 2 2.0...

14 years ago | 1

Answered
how can i obtain the final result after roipoly?
If you want to fill the polygon with interpolated grayscale, have a look at <http://www.mathworks.co.uk/help/toolbox/images/ref/...

14 years ago | 0

| accepted

Answered
How can I add new column in a dataset array but not at the end?
To insert a column of NaNs after column c of matrix A, you could use Anew = [A(:,1:c) NaN(size(A,1),1) A(:, c+1:end)]; T...

14 years ago | 0

Answered
audio sampling rate from not equally spaced samples
Yes, have a look at <http://www.mathworks.co.uk/help/techdoc/ref/interp1.html interp1>.

14 years ago | 0

Answered
Error in ==> thestest at 2 if(nargin == 2), ??? Output argument "y" (and maybe others) not assigned during call to "C:\Users\ raj\Documents\MATLAB\thestest.m>thestest".
It's a bit hard to say as you don't show the code in your question, but it may be that you have not assigned a value to the outp...

14 years ago | 1

| accepted

Answered
decimal array from logical array
2*a(:, 1:2:end) + a(:, 2:2:end)

14 years ago | 1

| accepted

Answered
Find a vector in a structure
One method: % Test data vortex(1).points = [1 2 3; 4 5 6; 7 8 9]; vortex(2).points = [9 9 9; 8 8 8]; searchv = [9 9 9];...

14 years ago | 0

Answered
Cant solve x*A=y
A is rank-deficient, so there isn't a unique solution. If you modify A to give it full rank, then x = y/A computes x ...

14 years ago | 0

Answered
what is wrong with my code
The function definition (starting with the word "function") should go into its own m-file, called fun.m in this case. Make sure ...

14 years ago | 0

| accepted

Answered
Homography Matrix
You don't say what you are starting from. If you have a set of matched input and output points, one possible method is given <ht...

14 years ago | 6

Answered
IS this right or not about calculation of Total Variation (TV) for image y?
I don't know, but an easy initial check is to see whether it gives the same answer as var(y(:)) or possibly var(y(:...

14 years ago | 0

Answered
does imdilate and imerode "flip" neighborhoods?
It's sometimes easiest just to look at a very simple example to see what happens. Here's one: >> img = [0 0 1 0 0]; >> se = [...

14 years ago | 0

Answered
cell array of classes
Is there any reason to use a cell array rather than an array of Aclass objects? The latter should be more efficient in both time...

14 years ago | 1

Answered
how to specify positions of the blocks in an image
Suppose you have B = im2col(A, [2 2]); and the size of A is [64 64]. Then B(1,k) comes from A(r,c) where c = floor((k-1)/...

14 years ago | 0

Load more