Answered
Resizing an array - removing elements
Here is an example showing how this can be done automatically: >> X = rand(4,3); % 4*3 = 12, not divisible by 5 >> R = 5...

11 years ago | 0

Answered
How to filter an array?
>> A = [0;0;0;0;0;0;1;1;1;0;0;0;0;0;0;1;0;0;0;0]; >> X = find(diff([0;A;0])); >> Z = zeros(size(A)); >> Z(fix((X(1:2:...

11 years ago | 0

Answered
I cant CREATE array the rand() in for loop..... Firstly, generate 72 bit binary number in 20 times. After, i need use the second, tenth or fifth generated random binary number.
Because |popSize| is scalar, the code random_chromosome(popSize) refers to *one* element of the array |random_chromosome...

11 years ago | 0

| accepted

Answered
Parallel two for loops
You iterate over two nested loops, but only the final value of the internal loop is saved (which is always five). Thus you end u...

11 years ago | 0

Answered
Another eval question: evaluating array byte order
One easy way would be to define an anonymous function, depending on the byte order: if file_endian == 0 tmp_fun = @(...

11 years ago | 0

| accepted

Answered
Why two different ways of expressing the same logical condition lead to two different results ???
The basic problem is that you are attempting *two* <http://www.mathworks.com/help/matlab/ref/relationaloperators.html logical re...

11 years ago | 0

| accepted

Answered
Help to construct vectors
Here is the first solution using the <http://www.mathworks.com/help/matlab/ref/colon.html |colon|> operator: >> 20:-1:10 ...

11 years ago | 0

| accepted

Answered
Plotting vector with different time starting value on x axes?
Why not just read the <http://www.mathworks.com/help/matlab/ref/plot.html |plot|> documentation? You simply need to supply all |...

11 years ago | 0

| accepted

Answered
How to force nansum(NaN+ NaN) = NaN, not 0 ?
Just keep track of where _all_ elements are |NaN|, and replace their sum with |NaN| after using |nansum|. You should be able to ...

11 years ago | 1

| accepted

Answered
How to get one vector from several matrices?
S = [reshape(A.',[],1);B(:);C(:)].';

11 years ago | 0

| accepted

Answered
Code to change matlab window size?
A much easier alternative would be to *dock* the figure, which places it within the main MATLAB window and thus makes everything...

11 years ago | 0

Answered
Why does chol([4, -4;-4, 4]) fail to produce an answer?
Actually that matrix is not positive definite. From the <http://www.mathworks.com/help/matlab/ref/chol.html |chol|> documentatio...

11 years ago | 0

| accepted

Answered
Adding a second for loop to create different matrices
*Solution* Use a <http://www.mathworks.com/help/matlab/matlab_prog/access-multiple-elements-of-a-nonscalar-struct-array.html ...

11 years ago | 0

Answered
Errors using imwrite "Unable to determine the file format from the filename" I am trying to splice together the name of a new image file but dont understand why imwrite isnt working.
You could try reading the <http://www.mathworks.com/help/matlab/ref/imwrite.html |imwrite|> documentation. At the top of the pag...

11 years ago | 1

| accepted

Answered
Why i am getting this error? How do i correct this error?
That error message is quite clear: you are getting the error because although you are calling |findFreqItemsets| it has not been...

11 years ago | 0

Answered
May i know is it possible to convert an image from 101 x 101 uint8 to 101 x 101 x 3 unit8
Here is the simplest way to convert a 2D image to a 3D image: rgbImage = grayImage(:,:,[1,1,1]);

11 years ago | 0

| accepted

Answered
How to write a loop that spells the word “aluminum,” adding one letter at a time?
>> S = 'aluminium'; >> for k = 1:numel(S), disp(S(1:k)), end a al alu alum alumi alumin alumini alu...

11 years ago | 0

| accepted

Answered
'Conversion to double from cell is not possible.'
Try tmp = repmat({{}},1,nCols); Postfix = struct('matches',tmp,'postfix',tmp) Your original problem is that you defin...

11 years ago | 0

| accepted

Answered
how to format integer numbers to start with filling zeros?
This only makes context in terms of strings, in which case |sprintf| makes this easy: >> sprintf('%02d ',1:12) ans = 01 ...

11 years ago | 5

| accepted

Answered
how to display value 0,5000,10000,15000,20000,25000,30000,35000,40000,45000 on y-axes in bar graph matlab
This page explains how to change the tick labels: <http://www.mathworks.com/help/matlab/creating_plots/change-tick-marks-and-...

11 years ago | 0

| accepted

Answered
How do I replace data in an array in a specific order?
*Method One: |rem|:* UTC_Data = [86100 1; 86200 2; 500 3; 86400 4; 1000 5]; I_Time = 86000; T_Diff = 86400 - I_Time; ...

11 years ago | 0

| accepted

Answered
how to do this calculation not by 'for' cycle?
This is easy using <http://www.mathworks.com/help/matlab/ref/accumarray.html |accumarray|>: inp = [1,1,1,53.1100;1,2,2,59.0...

11 years ago | 0

Answered
edit text in GUI as password??
Simply search this forum and also File Exchange: <http://blogs.mathworks.com/pick/2007/10/05/masking-typed-passwords-with-ast...

11 years ago | 1

| accepted

Answered
"Index out of bounds" error
You are trying to access an array element that does not exist. Basically you have something like this: >> X = [1,2,3] >>...

11 years ago | 0

| accepted

Answered
how can I convert comma with decimal points for a lot of textfiles?
MATLAB high-level data reading functions (eg <http://www.mathworks.com/help/matlab/ref/textscan.html textscan>, <http://www.math...

11 years ago | 3

Answered
size() for images
The size documentation tells us: " d = size(X) returns the sizes of each dimension of array X in a vector, d, with ndims(X) ele...

11 years ago | 3

| accepted

Answered
generating 3D vector in MATLAB
The error message tells us the error occurs on this line: Rx=(XX)-Loc([]); Those variables are hardcoded as: Loc=[]...

11 years ago | 0

Answered
Help with use of regular expression
Your example indicate that you want to convert these string numbers to numeric, and then collect the runs of one value together ...

11 years ago | 0

| accepted

Answered
How to sum out all the 1 in the bw image?
This is <http://www.mathworks.com/matlabcentral/answers/259709#answer_202816 my answer> to <http://www.mathworks.com/matlabcentr...

11 years ago | 1

| accepted

Answered
How to compare the pixel of two image?
Write <http://www.mathworks.com/help/matlab/matlab_prog/vectorization.html vectorized code>, it makes you life much easier: ...

11 years ago | 0

| accepted

Load more