Answered
Generate random number
Read the help of both functions and then take a look at NORMRND

15 years ago | 0

Answered
how to find maximum and second maximum number from vector.
One of the easier alternatives: m1 = mode(x) xcopy = x ; xcopy(x==m1) = [] m2 = mode(xcopy) Another options uses ...

15 years ago | 0

| accepted

Answered
load multiple files with a condition on the file name
dfBASF = dir('*BASF.mat') ; for F = {dfBASF.name} curF = F{:} ; % current file disp(curF) movefile...

15 years ago | 0

| accepted

Answered
Expanding Matrix
No need for loops, cell2mat or cellfun. Here is the simple approach using indexing: % data A = [1 2 3 ; 4 5 6] e...

15 years ago | 0

Submitted


RANDBLOCK
scramble matrices using blocks (v2.3, mar 2011)

15 years ago | 1 download |

4.0 / 5
Thumbnail

Answered
Inserting rows (location specified by ID)
Take a look at *insertrows* that ... well ... insert rows at locations specified by row indices. The problem than becomes ho...

15 years ago | 0

Answered
for loop
In the Matlab Editor, # select the text you want to tidy up # use the menu "Text" -> "Smart Indent" (or the shortcut, which...

15 years ago | 1

Answered
Append numbers to matrix
Why bother? Simply read in the values, append to the previous matrix and do a simple RESHAPE when needed.

15 years ago | 0

Answered
how to reshape an n x 1 matrix into a squre matrix using matlab?
This function will take any vector (or even a matrix) V and reshapesit into the smallest square matrix that can hold it. _Note t...

15 years ago | 1

| accepted

Answered
Testing for identical numbers in matrix columns
Nothing shorter than: ~std(A)

15 years ago | 4

Submitted


MOVENAN (v1.0, mar 2011)
Move NaNs to the beginning or end of a column

15 years ago | 1 download |

0.0 / 5

Answered
Find index of cells containing my string
So, your original array was a cell array of cells with a single string. Use STRCMP and FIND to get the indices of the cells with...

15 years ago | 17

Answered
Search nx3 array row-wise for 2 equal elements
Here is another idea. First create an upper triangular 3D logical matrix (OLP) in which the elements OLP(k,j,i) (with j>k) repre...

15 years ago | 0

Answered
Adding arrays found using 'who' function
This is one of the (rare) cases EVAL comes in handy. evalStr = sprintf('%s+', Find_Target_Vars{:}) ; evalStr = evalStr(1...

15 years ago | 0

| accepted

Answered
.coe file in matlab
Here is the link to the documentation: <http://www.mathworks.com/help/toolbox/filterdesign/ref/coewrite.html>

15 years ago | 0

| accepted

Answered
Random values from histogram
Standing on the shoulder of a giant WR, the following run-length based code will create a random list of 10 values that are deri...

15 years ago | 2

| accepted

Answered
Transfer the data from dos command prompt to MATLAB GUI text box
Check the help of the OS how to copy/paste from the command window.

15 years ago | 0

Answered
Randomly generate a matrix of zeros and ones with a non-uniform bias
The following gives you a matrix with exactly a certain number of 1's sizeR = [3 4] ; num1 = 8 ; R = zeros(sizeR)...

15 years ago | 3

Answered
Problem with Inputdlg function
You can set the resize option of inputdlg to on, as described in the help, although I doubt this will help you a lot. However,...

15 years ago | 0

| accepted

Answered
Permute matrix elements across rows
I suggest to split the matrix into the elements you want to make combinations of using MAT2CELL X = [2 4 1 ; 5 3 6] ; % a dis...

15 years ago | 1

Answered
Simulating human vision system.
There is no answer for this question (if it is a question at all ...). I can only give you this advice: go to the one who asked ...

15 years ago | 0

Answered
Loop that creates arrays
If all the arrays are vectors (=1D arrays in matlab) you can store them in a matrix (=2D array). % Pre-allocate an matrix wit...

15 years ago | 3

| accepted

Answered
Cutting rows and columns from a matrix
See ANY (or ALL). You need a two step approach: A = [1 0 1 0 ; 1 0 1 0 ; 0 0 0 0] B = A(any(A,2),:) ; % remove null rows ...

15 years ago | 1

| accepted

Answered
How do I use randperm to produce a completely new sequence (no numbers in same place)?
I just resubmitted RANDPERMFULL to the FEX. It will be available in few days. To the OP, should the next permutation be diffe...

15 years ago | 1

Submitted


FLIPXYVIEW (v2.0, mar 2010)
flips (mirror rotates) the horizontal and vertical plot axes

16 years ago | 1 download |

5.0 / 5
Thumbnail

Submitted


CELL2FLOAT
converts cell array into scalar float array (v4.0, jan 2010)

16 years ago | 1 download |

4.66667 / 5

Submitted


UNIQUEWITHEQUALNANS
Set unique, treating NaNs as equal (v2.0, mar 2009)

17 years ago | 1 download |

5.0 / 5

Submitted


BALLATSQ
Create a balanced latin square (v2.2, mar 2009)

17 years ago | 1 download |

5.0 / 5

Submitted


NDLINSPACE (v1.1, feb 2008)
Generalized LINSPACE: linearly spaced values between mutliple points

17 years ago | 1 download |

4.0 / 5

Submitted


FINDIND
find indices of matching elements between two matrices (v2.0, jan 09)

17 years ago | 2 downloads |

0.0 / 5

Load more