Answered
problem in writing matlab code (To Plot)
K = 1; x = linspace(-100,100); A = K/2*(1 + cos(x)); A(x<=0) = 1; A(x>=50) = 0; plot(x,A)

11 years ago | 0

| accepted

Answered
Hello everybody, my output is a structure like Run = theta: {1x10 cell} sigma:{1x10 cell} I want to compute the mean of theta and sigma. I would be grateful if you could lead howI should do that?
mean(cell2mat(Run.theta)) mean(cell2mat(Run.sigma)) You could also rewrite your program and return a 10x2 matrix Y with th...

11 years ago | 0

Answered
RGB values in a YUV colorspace image
imshow treats the image as an RGB image. If it is not, e.g., if some values are negative, these values are set to 0. Note that i...

11 years ago | 0

Answered
How can I calculate average values of one data according to specific indexes of same size?
X = [1 1021.714 1 1021.726 2 1021.736 2 1021.743 2 1021.749 2 1021.755 2 1021.760 2 1021.765 3 1021.7...

11 years ago | 0

| accepted

Answered
How can I write a mathematical function in Matlab?
If X take some values and you make sure that the e and p parameters are in the order of pairs, e.g., for N = 3 1 2 1 ...

11 years ago | 0

Answered
Parallel program required to be fixed for last couple of lines due to extensive time-consuming for saving variables in 3 by 3 matrix
If is more efficient if you allocate Ex, RondF_RondEta and RondF_RondZeta before the loop: Ex = nan(1, TotNu); RondF...

11 years ago | 0

Answered
how do i remove this error? Function definitions are not permitted in this context.
You can write it w/o a function, and you don't need the inner for j= ... loop: for day=1:10 %// Generate 3 particles ...

11 years ago | 0

| accepted

Answered
Two times fft of the signal
Yes. It's a property of the Fourier Transformation: the FT of a box is a sinc, and the FT of a sinc is a box. So if you compute ...

11 years ago | 0

| accepted

Answered
Dots!, Dots!, Dots! What are they doing!?
help punct gives you ... Continuation. Three or more periods at the end of a line continue the current comman...

11 years ago | 0

| accepted

Answered
Extract the number within the bracket
This extracts all digits and all '.' from a: numstr = a(regexp(a, '[\d\.]')) This extracts all numbers between ( ), where...

11 years ago | 0

Answered
finding specific values' rows numbers in an array
find(a==4) find(a==7)

11 years ago | 0

Answered
I don't know this watermarking code~ please explain code~
You can download the full example from http://www.mathworks.com/matlabcentral/fileexchange/45051-color-dwt-image-watermarking ...

11 years ago | 0

| accepted

Answered
How to calculate zero mean and unit variance for entire vectors in a folder?
1. Determine all excelfiles in the folder (hint: d = dir(',', '*.xls')) 2. loop over all these files and 3. read file (h...

11 years ago | 0

Answered
How to allocate variables
Assuming that your L is a matrix, you simply store the ith L as allL(:,:,i) = L; To make the code more efficient, you...

11 years ago | 1

| accepted

Answered
HELP to resolve this code
function d = brightnessdiff(I1, I2) d = rgb2gray(I1) - rgb2gray(I2);

11 years ago | 0

Answered
Approximate Entropy Calculation for an Image
function E = entropy(I) % Assume I in the range 0..1 p = hist(I(:), linspace(0,1,256)); % create histogram p(p==0) =...

11 years ago | 0

| accepted

Answered
How to convert a vector into bitstring?
Vector = [255 1 0]; reshape(dec2bin(Vector)', 1, [])

11 years ago | 0

Answered
How to run a function?
You have defined your function f with a single argument x but you call it with two arguments x(1) and x(2) in using fx=feval(f,x...

11 years ago | 0

| accepted

Answered
How can i assemble a 4x4 matrix into a 12x12 matrix (Stiffness Matrix)
To get the first submatrix, you can use k1= [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16]; u = 2; v = 4; X = zeros(1...

11 years ago | 1

Answered
is it possible to plot and save figure in console mode?
x = 1:10; y = x; h = plot(x, y); % Save plot in png format using hgsave hgsave(h, 'sample.png');

11 years ago | 0

Answered
problem in ycbcr color space
You have some error in your formula. RGB values in the range 0, 255 or R'G'B' values in the range 0..1 map to non-negative YCbCr...

11 years ago | 0

Answered
What should i use if i dont want to perform any operation?
You can rewrite your if-clause as if condition1 operation1 elseif ~condition2 operation3 end

11 years ago | 1

Answered
Adding two functions to 1 m-file, while making variables in the two functions accessible to both?
Define function F1 and use the matrices read by F2 as the default arguments. function Y = F1(A1,A2) if isempty(A1) && is...

11 years ago | 0

Answered
How to randomly select n number of pixels from an image whose value is one and change those pixels value to zero?
ind = find(I == 1); r = randperm(numel(ind)); r = r(1:n); I(ind) = 0;

11 years ago | 0

| accepted

Answered
Why does Matlab give different eigenvalues for the same matrix?
Are you 100% sure that you used the same matrix for your computations?

11 years ago | 0

Answered
How to randomly select n number of pixels from an image whose value is one ?
ind = find(I == 1); r = randperm(numel(ind)); r = r(1:n);

11 years ago | 0

| accepted

Answered
Error: Attempted to access E(-251); index must be a positive integer or logical
In Matlab the indices have to be integer numbers > zero. So if you use E(i) = sqrt(mean(deviation)); A(i) = mean(snip...

11 years ago | 1

Answered
How do I Generate a binary image from first principles?
So far you use fill to plot the region. But that's in a figure, not an in an image. For example, to generate a binary image w...

11 years ago | 0

| accepted

Load more