Réponse apportée
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))

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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)

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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 ';']);

plus de 10 ans il y a | 0

Réponse apportée
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 ...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
finding specific values' rows numbers in an array
find(a==4) find(a==7)

plus de 10 ans il y a | 0

Réponse apportée
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 ...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
HELP to resolve this code
function d = brightnessdiff(I1, I2) d = rgb2gray(I1) - rgb2gray(I2);

plus de 10 ans il y a | 0

Réponse apportée
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) =...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
How to convert a vector into bitstring?
Vector = [255 1 0]; reshape(dec2bin(Vector)', 1, [])

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 1

Réponse apportée
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');

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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

plus de 10 ans il y a | 1

Réponse apportée
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...

presque 11 ans il y a | 0

Réponse apportée
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;

presque 11 ans il y a | 0

| A accepté

Réponse apportée
Why does Matlab give different eigenvalues for the same matrix?
Are you 100% sure that you used the same matrix for your computations?

presque 11 ans il y a | 0

Réponse apportée
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);

presque 11 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 11 ans il y a | 1

Réponse apportée
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...

presque 11 ans il y a | 0

| A accepté

Charger plus