Respondida
combining planes of data
M = cat(3, plane1, plane2, plane3,[more planes], plane512);

alrededor de 10 años hace | 1

Respondida
Simple way to wrap quotes around input
str = ['''' str ''''];

alrededor de 10 años hace | 1

Respondida
How to mirror matrix on the diagonal?
I2 = rot90(fliplr(I),-1);

alrededor de 10 años hace | 4

| aceptada

Respondida
I have a problem with a plot
plot(x, y1); hold on plot(x, y2) or plot(x, y1, x, y2)

alrededor de 10 años hace | 1

Respondida
Low computation efficiency of simple sentence in MATLAB
Instead of X = repmat(lambda_old1,1,4).*[W1(:,i),W3(:,i),W2(:,i),W4(:,i)]; if might be faster to use X = bsxfun(@time...

alrededor de 10 años hace | 1

| aceptada

Respondida
How can I correct inhomogeneous intensity in image?
I = im2double(imread('blob.bmp')); y = mean(I(:, 1:100), 2); sigma = 30; % choosen by visual inspection G = f...

alrededor de 10 años hace | 0

| aceptada

Respondida
How can I solve the " Index exceeds matrix dimensions" error for the following code ?
Don't use negative indices like -2, they are always invalid. Valid indices in Matlab start with 1 and end with the number of ele...

alrededor de 10 años hace | 0

Respondida
reading a .txt
First check if the encoding is ISO-8859-1, such that accents are read correctly: if ~strcmp(feature('DefaultCharacterSet'), ...

alrededor de 10 años hace | 0

Respondida
i have to save colour thresholded images in different folder according to their rgb values , but i can't work ..all the images are showing with the imshow() function but it can't stored on different folder as per their rgb values..pls help this out
Something is wrong with your condition, "out" is undefined. You can write if(red>88 & red<111 & green >86 & green <104 &...

alrededor de 10 años hace | 0

Respondida
Randomize three chosen arrays in matlab
A = [0,0,1]; B=[0,1,0]; C=[1,0,0]; X = [A; B; C]; x = X(sub2ind(size(X), 1:3, randi(3, [1, 3])))

alrededor de 10 años hace | 0

Respondida
concatenate all value in a matrix into one number
This works even if the numbers are not single digits, i.e., in in {1,2,...,9} v = [10 20 4]; num = sscanf(sprintf('%d', v...

alrededor de 10 años hace | 0

| aceptada

Respondida
Connecting line between different points obtained from a for-loop
x = 1:20; y = x+2; plot(x,y,'*-')

alrededor de 10 años hace | 0

Respondida
Matlab delete's value's from array
You remove all rows that contain a NaN in the line k(any(isnan(k),2),:)=[]; and then you assign the variables varia...

alrededor de 10 años hace | 0

Respondida
how can i find the displacement in pixels for the 1st, 3rd and 5th squares in the picture
% number here found by visual inspection I = im2double(imread('1.JPG')); index_center = size(I,2)/2+100:size(I,2...

alrededor de 10 años hace | 1

| aceptada

Respondida
Change the default filling of a matrix
I do not know anyway to change the default behaviour of Matlab to fill the empty positions with zeros. So you have to do it in t...

alrededor de 10 años hace | 0

Respondida
Trying to make a "snake" matrix?
N = 5; M = 9; T = reshape(1:M*N, [M, N])'; T(2:2:end,:) = fliplr(T(2:2:end,:));

alrededor de 10 años hace | 0

| aceptada

Respondida
Elimination of rows in array
A(A(:,1)+A(:,2) < A(:,3) | A(:,1)+A(:,2) > A(:,4), :) = [];

alrededor de 10 años hace | 0

| aceptada

Respondida
setting the position of the legend
The height of the box is the fourth parameter of the position. To reduce the size you can do the following: p = leg.Positio...

alrededor de 10 años hace | 0

Respondida
How to make this complicated array
x = 5; y = 8; a(x,y) = 0; a([1:x 2*x:x:y*x y*x-1:-1:x*(y-1)+1 x*(y-2)+1:-x:x+1]) = 1:2*x+2*(y-2);

alrededor de 10 años hace | 0

Respondida
Comparing a number matrix to certain values and storing it in another array / matrix
R = 5*rand(4); A = zeros(size(R)); A(R>=1 & R <= 2) = 1; B = zeros(size(R)); B(R>=3 & R <= 4) = 2;

alrededor de 10 años hace | 0

Respondida
How to replace name with number
[~, ~, xnum] = unique(x, 'stable')

alrededor de 10 años hace | 0

Respondida
How to change the language of 2015b (32bit) from english to chinese?
<http://de.mathworks.com/help/matlab/internationalization.html>

alrededor de 10 años hace | 0

Respondida
Creating file names for save command
file_dir = 'C:\Users\mydir'; datestamp=char(datetime('now','TimeZone','local','Format','yyyyMMdd_HHmmss')); file_name...

alrededor de 10 años hace | 0

Respondida
How to assign two values randomly among 2 variables?
idx = rand(100,1); sensor1 = c1; sensor1(idx>0.5) = c2; sensor2 = c1; sensor2(idx<=0.5) = c2;

alrededor de 10 años hace | 0

Respondida
Find a pair of elements in a 3d matrix
Logical index: idx = A(:,:,1) == 0 & A(:,:,2) == 0; if you prefer a single index, you can use idx2 = find(idx); if...

alrededor de 10 años hace | 0

| aceptada

Respondida
optimization to get the least ratio of variables for two functions
You get the index of the minimum ratio A/B using [~, idx] = min(A./B);

alrededor de 10 años hace | 0

Respondida
How to calculate compound interest?
If you have amount A at an interest rate of r, you have after one month A + rA = A(1 + r) after two months A(1+r) + ...

alrededor de 10 años hace | 0

Respondida
How can I create shortcuts to layouts
You can set Shortcuts under Matlab > Preferences > Keyboard > Shortcut, but only for some pre-defined actions; changing the layo...

alrededor de 10 años hace | 0

Respondida
Save multiple images in a folder
You have to use a new name for each image; e.g., for your i'th image: filename = sprintf('myimage%02d.png', i);

alrededor de 10 años hace | 0

Cargar más