Answered
Find the mean value and an array and then eliminate the value from an array which is greater than mean
Take a look at logical indexing. In pseudocode TF = A > xxx % logical vector A(TF) = [] % logical indexing B(TF) =...

11 years ago | 1

Answered
Removing rows from all columns based on values of one column
Here is an example X = randi([1 10],10,3) % example data TF = X(:,3) > 5 % for which rows is column 3 larger than 5...

11 years ago | 1

| accepted

Answered
How can i convert number to letter?
Take a look at cell arraysof strings. Use the number directly as indices into a cell array, or convert using some scheme (like 1...

11 years ago | 0

Answered
Select every Nth row from number groups
a = [1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 1] k = 1 ; while any(a) i0 = strfind([0 a],[0 1]) ; OUT{k} = i0...

11 years ago | 0

Answered
how can i find more than one minimum points of the histogram??
You can sort the outcome of the histogram data = ceil(10*rand(100,1)) values = 1:10 count = histc(data,values) [...

11 years ago | 0

Answered
How to load different data files in a for loop
for n=1:6, filename = sprintf('log_%d.mat',n) S = load(filename) % S is a structure with the variables inside ...

11 years ago | 1

| accepted

Submitted


CATSTRUCT
Concatenate/merge structures (v4.1, feb 2015).

11 years ago | 11 downloads |

4.8 / 5

Question


File Exchange - Quickly see comments?
Maybe I am missing something, but how can I now quickly see if people have made new comments on my own files? The new look of th...

11 years ago | 3 answers | 0

3

answers

Answered
How to sort each row of 120x200 array and keep track of column number ?
Use the second output of SORT: A = [7 8 2 1 ; 3 9 6 5 ; 5 2 1 9] [Asorted, OrigColIdx] = sort(A,2)

11 years ago | 4

| accepted

Answered
How I make circular grid without using meshgrid or rectangle?
I think your approach is very straightforward. Everything I can think of right that does not generate grid points being thrown a...

11 years ago | 0

Answered
1-D interpolation of histogram
help histc help interp1 With HISTC you can count the number of occurrences in a bins. Afterwards you can simply multiply...

11 years ago | 0

Answered
finding and storing non zero elements in a NxN matrix
help find M = rand(5) < 0.2 ; % some data [r,c,v] = find(M) ; % row and column indices of non-zero elements (with va...

11 years ago | 0

Answered
How to select multiple ranges of plot data to a cell array
Can you precisely formulate why you select those parts of the plot?

11 years ago | 0

| accepted

Answered
how to do a conditionnal mean
Something along these lines should work (assuming FYEAR and DY are numerical arrays) FYEAR = [10 10 11 12 11 10 12 12 10] ...

11 years ago | 0

Answered
How do I generate a sampled sequence with frequncy p(n)
See <http://www.mathworks.com/matlabcentral/fileexchange/8891-randp RANDP> on the file exchange X = [10 20 30] % observ...

11 years ago | 0

Answered
Subscript indices must either be real positive integers or logicals.
Check the values of the indexing variables, for instance, using: disp(i) disp(refBlkVer) It will probably show that t...

11 years ago | 0

Answered
Check if a function handle is valid
You might be interested in the function <http://www.mathworks.nl/matlabcentral/fileexchange/45778-isfunction/content/isfunction....

11 years ago | 0

Answered
Create matrix using nested loops
Note that * Indexing in ML starts at 1 * You should rarely change the iterator inside the loop * sin and cos take radians, ...

11 years ago | 0

Answered
How to acces a variable in structure when i only have the string saved into a variable
This would be an approach [filename, pathname] = uigetfile('*.mat', 'Select the MATLAB mat file'); tmp = load(filename);...

11 years ago | 2

| accepted

Answered
What format is y in y=wavread('file')? Difficulty in finding peaks of a wav file as y is not a vector.
what does size(xn) returns? It might be N-by-2 for stereo wave files

11 years ago | 0

Answered
strfind: how to set a cell for the pattern?
Then please explain the relationship between a,b,and c. Why is c{2} equal to 1?

11 years ago | 0

Answered
strfind: how to set a cell for the pattern?
% implicit for with CELLFUN c = cellfun(@(x) strfind(x,b), a, 'un', 0)

11 years ago | 0

Answered
Matrix creation which identify link of vehicles
M = accumarray(A(:,[2 3]), A(:,1), [81 81], @(x) {x})

11 years ago | 1

Answered
Matrix which cells have multiple values
This can be done with a simple one-liner: M = accumarray(A(:,[2 3]), A(:,1), [81 81], @(x) {x}) M will be a 81-by-81 cel...

11 years ago | 1

| accepted

Answered
Classification of a matrix to 0 and 1 matrix
A = [1,7,1 ; 2,2,1 ; 2,4,2 ; 3,13,2 ; 3,11,2 ; 4,6,2 ; 5,2,2 ; 5,2,2 ; 5,9,1 ; 6,7,1 ; 6,10,2 ; 7,8,1 ; 7,6,2 ; 7,6,2 ; 7,6,1 ...

11 years ago | 2

Answered
Build huge matrix with vector components
n = 4 % a small example m = 3 [a, b] = ndgrid(1:n,1:m) pos = [0 0 ; b(:) a(:)]

11 years ago | 1

| accepted

Answered
How do I smooth a plot ?
If you have the signal processing toolbox FILTFILT, otherwise FILTER x = [2 4 6 8 10 10 10 10 10 10 10 10 10 10 ] ; y ...

11 years ago | 0

| accepted

Answered
How to define variable that itself contains one or more variables ?
You do not want to store things like Q1 = .. Q2 = .. .. Q98293 = .. in gazillion different, but related, variables You w...

12 years ago | 0

Answered
For each non NaN value in the 2rd column, remove the entire row of Cell
Despite raw being a cell, are there only numbers in the second column? If so: tf = isnan(vertcat(raw{:,2})) ; raw2 = raw...

12 years ago | 0

Answered
NaN selective removal from a matrix
tf1 = isnan(a) tf2 = all(a,2) tf3 = ~tf2 b = a(tf3,:) b2 = a(~all(isnan(a),2),:) % in one giant leap

12 years ago | 0

| accepted

Load more