Respondida
How do I find the first value (in a vector) larger than a cutoff value without using for/while loops?
v(find(v > cutoff, 1))

casi 11 años hace | 0

| aceptada

Respondida
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)

casi 11 años hace | 0

| aceptada

Respondida
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...

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 0

| aceptada

Respondida
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 ...

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 0

Respondida
I have a string with the form of that of what you would write to initialize a matrix; how do I make the string a matrix?
myStr = '[1,2,3, 5:7]'; eval(['A = ' myStr ';']);

casi 11 años hace | 0

Respondida
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 ...

casi 11 años hace | 0

| aceptada

Respondida
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 ...

casi 11 años hace | 0

| aceptada

Respondida
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...

casi 11 años hace | 0

| aceptada

Respondida
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...

casi 11 años hace | 0

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

casi 11 años hace | 0

Respondida
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 ...

casi 11 años hace | 0

| aceptada

Respondida
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...

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 1

| aceptada

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

casi 11 años hace | 0

Respondida
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) =...

casi 11 años hace | 0

| aceptada

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

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 0

| aceptada

Respondida
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...

casi 11 años hace | 1

Respondida
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');

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 0

Respondida
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

casi 11 años hace | 1

Respondida
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...

alrededor de 11 años hace | 0

Respondida
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;

alrededor de 11 años hace | 0

| aceptada

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

alrededor de 11 años hace | 0

Respondida
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);

alrededor de 11 años hace | 0

| aceptada

Respondida
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...

alrededor de 11 años hace | 1

Respondida
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...

alrededor de 11 años hace | 0

| aceptada

Cargar más