Réponse apportée
How to get rid of the error: Error using horzcat. Dimensions of matrices being concatenated are not consistent.
This is not going well: thisLine=imresize(thisLine,[100 100]); imwrite(thisLine,['Datasets/',num2str(thisLine),'.jpg']);...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
Write a computer program that determines how many grades are between 0 and 19
help numel help for help if or help histc

presque 10 ans il y a | 0

Réponse apportée
Why do I get this error "In an assignment A(:) = B, the number of elements in A and B must be the same"?
You seem to use the variable n in two ways: # an unsorted variable (vector? or array?) # the number of elements of something...

presque 10 ans il y a | 1

| A accepté

Réponse apportée
Difficulty with nested loop and arrays
for RowIndex = 1:... for ColIndex = 1:... CurrentValue = MyMatrix(RowIndex,ColIndex) end end...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
Vectorize for-loop that changes overlapping parts of an array
Easy when using convolution: logarray = logical([0 1 1 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 1]) N = 2 ; out = conv2(...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
find combination of labels
A simple one-liner will do A = [618 574 608] B = [574 2;574 3;608 1;618 1;618 2;618 3;618 4] C1 = arrayfun(@(k) B(B(:...

presque 10 ans il y a | 0

Réponse apportée
How to I use previously calculated value in next iteration until the value converges?
Your for loop just runs once, using the single value of a. You might do better using a while loop % init values go here ...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
How to create double spacing between all command prompts
No, you cannot change those properties in matlab. But why not copy the command window to a text processor and change everythi...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
Sum of numbers from a notepad file
If the text file only contains numbers,and there are the same amount on each row, try using load to read the file in matlab: ...

presque 10 ans il y a | 1

Réponse apportée
FInd the distribution of some random numbers
There are so many distributions that you have to make some choices. First, look at the distribution of your numbers and, by shee...

presque 10 ans il y a | 0

Réponse apportée
Logical indexing two dimensions. How do I avoid a nested for loop?
Pre-allocate *but also* put the transpose out of the loop! T = T.' ; A = zeros(400,400,9,64) for n = 1 : 64 fo...

environ 10 ans il y a | 0

Réponse apportée
remove rows under certain condition
Assuming your X, Y, and Z variables are stored in three vectors of equal length [UniqueXY, ~, k] = unique([X(:) Y(:)],'rows...

environ 10 ans il y a | 1

| A accepté

Réponse apportée
Formula for Poisson distribution
I am not sure why you have three parameters rather than 1. See <https://en.wikipedia.org/wiki/Poisson_distribution> In your c...

environ 10 ans il y a | 1

| A accepté

Réponse apportée
how many times a string is present in a cell array
One of the simplest ways: a = {'2';'23';'231';'2312';'23121';'231213';'3';'31'}; b ={'2','21','','','','','';'3','32','...

environ 10 ans il y a | 1

Réponse apportée
How to manipulate arrays inside a cell array?
Write a function that does this for a single element of the cell array and then use cell fun If you can write the function as a...

environ 10 ans il y a | 1

Réponse apportée
find a cell array of strings in another cell array of strings
So you want the keep the elements in B that are not in A. This is known is the difference in sets, implemented in matlab like th...

environ 10 ans il y a | 0

Réponse apportée
How to remove duplicates from a matrix without using unique?
I do not see any reason why you can't use *unique* A = randi(5,5,10) % some data C = arrayfun(@(k) unique(A(:,k),'stable...

environ 10 ans il y a | 0

Réponse apportée
How to remove duplicate observations in a matrix after sorting it?
FINAL=[1001,4,5,2015;1002,4,5,2015;1001,4,10,2014;1003,4,10,2014] X = sortrows(FINAL,[1 4 2 3]) % not sure what you want he...

environ 10 ans il y a | 0

Réponse apportée
how many times a string is present in a cell array
A job for COUNTMEMBER! Download it here from the file exchange: <http://www.mathworks.com/matlabcentral/fileexchange/7738-co...

environ 10 ans il y a | 1

Réponse apportée
How do I sum all the y values of a scatter plot to turn it into a histogram?
The second output of *histc* provides the bins in which each data point is located. You can use this to sum the elements grouped...

environ 10 ans il y a | 0

Réponse apportée
Steps between to elements of a matrix
This might help you further: A = [1 1 2 2 0 1 1 1 1 0; 1 0 2 2 0 1 1 1 1 0; 1 1 2 2 1 1 1 1 1 1; 1 1 2 2 1 1 0 1 0 1; 1 1...

environ 10 ans il y a | 0

| A accepté

Réponse apportée
Is it possible to convert/transform a normally distributed random variable to a Poisson-variable?
You could try an <https://en.wikipedia.org/wiki/Anscombe_transform Anscombe transformation>: y = 2 * sqrt(x + 3/8)

environ 10 ans il y a | 0

Réponse apportée
I cant create array x=[1 2], because of Attempt to execute SCRIPT horzcat as a function
What does the command which horzcat tell you? And does solve clear horzcat solve the problem?

environ 10 ans il y a | 0

Réponse apportée
swiching elements of same vector
Easy: X = [20 0 0 0 100 0 0 50 0]' [i,~,v] = find(X) X(i) = [0 ; v(1:end-1)]

environ 10 ans il y a | 1

Réponse apportée
About Cell arrays access
a{1}={'teste' 4}, a{2}={'meste' 5}, a{3}={'zeste' 6}, B = cellfun(@(x) x{1}(1),a)

environ 10 ans il y a | 0

Réponse apportée
is there anyone assist me for write a for loop that will calculate the power n of a given number x on MATLAB?
n = 4 x = 2 y = 1 for k=1:n y = y * x end [x.^n y]

environ 10 ans il y a | 1

| A accepté

Réponse apportée
How to apply efficient if-else statements in a big data cell array
It is a cell array, but each cell has a single number? Then you might be better of converting it to numbers first: N = cell...

environ 10 ans il y a | 0

Réponse apportée
delete first x number of rows from a cell array
Each cell in the 4th row of A should contain a scalar, being 0 or another value tf = [A{:,4}] ~= 0 Aout = A(tf,:)

environ 10 ans il y a | 1

Réponse apportée
i want to find row indices for each column having non zero values
A = [1 1 0 1; 1 1 0 0; 0 0 1 1] C = arrayfun(@(k) find(A(:,k)),1:size(A,2),'un',0) % C{x} holds the row numbers for whi...

environ 10 ans il y a | 1

Réponse apportée
Search all strings occuring in structure
So, I assume: * in your array A, A(1:8) belong to the same number, A(9:16) to another mother, etc.. * There are N mothers an...

environ 10 ans il y a | 0

| A accepté

Charger plus