Submitted


getkeywait
Wait a certain time for a single keypress

7 years ago | 5 downloads |

4.9 / 5
Thumbnail

Submitted


runindex
linear indices for each run in a vector (run length encoding, and decoding)

7 years ago | 1 download |

5.0 / 5
Thumbnail

Answered
To find Maximum value and minimum value for each group of four rows for a 1576*1024 matrix
Here is an accumarray trick H1 = randi(100,10,2) % sample data Nrows = 4 ; R = floor((0:size(H1,1)-1)/Nrows) + 1 ; R = repm...

7 years ago | 2

Submitted


nchoose
all combinations of the elements of a set

7 years ago | 1 download |

5.0 / 5
Thumbnail

Submitted


shake
Randomize a matrix along one dimension

7 years ago | 1 download |

4.4 / 5
Thumbnail

Submitted


ShakespeareInsult
returns a Shakespearian insult

7 years ago | 1 download |

5.0 / 5
Thumbnail

Answered
How to format the length of a line of text using fprintf in a loop
Why don't you format the values within each string to be nicely aligned, before sending them to a text file? A = rand(4,3) ; f...

7 years ago | 0

Answered
Best way to loop through multiple subfolders and run either script A or B depending on folder name?
If you have adopted a logical naming system for the files and directories, something simple like this would do: for P = 1:24 ...

7 years ago | 1

| accepted

Answered
select one element in each row but not the same column
A= [1 2 3; 4 5 6; 7 8 9] ix = logical(eye(size(A))) % one element per row ix = ix(:,randperm(size(ix,2))) % randomize accross...

7 years ago | 0

| accepted

Answered
Changing the Title of a plot in a nested loop
k = 3 ; str = sprintf('Run %d', k) title(str)

7 years ago | 0

| accepted

Answered
I would like to get an example of the difference between the maximum and minimum values by grouping grpstats or looping statements
Let M be your N-by-3 table, with columns [id1 id2 value] : [out, ~, gi] = unique(M(:,[1 2]), 'rows') out(:,3) = grpstats(M(:,3...

7 years ago | 0

| accepted

Answered
How to create a folder and save pictures
help mkdir help saveas p = 1 foldername = sprintf('Folder%02',p) mkdir(foldername) picturename = fullfile(foldername, 'm...

7 years ago | 0

Answered
how do i take the data from cells in a cell array and turn them into a data array
This is the accumarray solution that Stephen hinted to: T1 = [99 10 11 ; 99 20 21 ; 30 31 32] [~,~,ib] = unique(T1(:,1), 'stab...

7 years ago | 0

Answered
How to add string and number to a graph?
str = 'hello' gtext(str) % put the text interactively using your mouse

7 years ago | 0

| accepted

Answered
matrix with all possible combinations of 8!
You need permutations not combinations (which my function allcomb returns). Take a look at PERMS >> perms(1:3) 3 2 ...

7 years ago | 0

Answered
How do I print results of ANOVA to a title?
You have to create a string (character array) from the results of the ANOVA. Something like this [p,TB] = anova1(...) str = sp...

7 years ago | 0

Submitted


insertrows
Insert rows into a matrix at specific locations

7 years ago | 2 downloads |

5.0 / 5
Thumbnail

Submitted


countmember
Count members.

7 years ago | 3 downloads |

4.8 / 5
Thumbnail

Submitted


permn
Permutations with repetition, all or a subset

7 years ago | 8 downloads |

4.9 / 5
Thumbnail

Answered
How to use if statements with arrays?
You need to assign the i-th calculation the i-th element in y in the two conditions y(i) = ... To speed things up, especially ...

7 years ago | 2

Answered
Extract submatrix using a sliding window
My advise: create the proper index vector from windowsize and shift and use that to extract the rows A = [1 2 3; 4 5 6 ; 7 8 9 ...

7 years ago | 0

Answered
How to extract element of all matrices within a cell array using cellfun?
This looks like homework to me. Here is a big hint: Create a function that extracts this for you and use cellfun to apply it to...

7 years ago | 1

Submitted


PADCAT
concatenate vectors with different lengths by padding with NaN

7 years ago | 10 downloads |

4.9 / 5
Thumbnail

Answered
How to calculate mean of multiple arrays
If I read your question to the letter, you have 12263 recordings of pupil sizes. Each recording lasted 784 ms. Recoring frequenc...

7 years ago | 1

| accepted

Answered
leaving one out help
% One of the many ways ... N = 10 ; for k = 1:N s = [1:k-1 k+1:N] % your code using s end

7 years ago | 0

| accepted

Answered
Compares permutation in the matrix in another matrix.
tf = ismember(matrix_MbyN, vector_1byN, 'rows') rows_in_M = find(tf)

7 years ago | 0

Answered
Setting static text to equal a variable
a = 100 ; StaticText = sprintf('Health = %d', a)

7 years ago | 0

| accepted

Answered
How to choose image
Do not store them in two separate variables, but use a cell or struct array! It is the contents of variable that should vary, n...

7 years ago | 0

| accepted

Answered
How to get row index based on two columns
tf1 = strcmp(YourCellArray(:,2), 'Continuous') tf2 = cat(1, YourCellArray{:,3}) <= 80 DesiredRows = find(tf1 & tf2)

7 years ago | 1

Answered
How to change a value in an array when a condition is met?
Something like this? idx = Velocity(:,3) == 0 % where to change N = sum(idx) % how many to change p = [-1 1] ...

7 years ago | 0

Load more