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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

Beantwortet
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 ';']);

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 1

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 1

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

Beantwortet
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

etwa 11 Jahre vor | 1

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 1

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

etwa 11 Jahre vor | 0

| akzeptiert

Mehr laden