Answered
Determine set of data between multiple ranges from a matrix
It's hardly worth a function: large_column_vector = randi(80, 1024, 1); %demo data upper_bounds=[20 23 45 69]; lower_...

10 years ago | 0

| accepted

Answered
Preallocating memory for a cell array of unknown size & removing the empty rows in cells array
A(~all(cellfun(@isempty, A), 2), :)

10 years ago | 1

Answered
How can I index using cell arrays?
cellfun(@(b) A(b), B, 'UniformOutput', false)

10 years ago | 1

| accepted

Answered
how to get vector v=[1 3 5 7] to be d=[6 6 6 6 ]
v(1:end) = 6 or v = v*0+6; or v = v./v*6 or many other ways

10 years ago | 2

Answered
Blue colour range in hsv saturation system?
Hum!, the Hue channel (the one that contains the colour information) in a HSV image is the *first* one. The limits of the blu...

10 years ago | 0

| accepted

Answered
How do we eliminated columns in excel file has negative values?
To delete at once *all* the columns for which *all* the rows are negative: yourmatrix(:, all(yourmatrix < 0)) = [];

10 years ago | 0

| accepted

Answered
How to export numbers and date/times in a matrix?
Assuming you're on R2016b, the simplest way to solve your problem is to use the modern tools that have been implemented in recen...

10 years ago | 0

Answered
Matlab imported excel time format change
Assuming the date and time is stored as char arrays in both columns: dt = datetime(strcat(column1, ' ', column2), ... ...

10 years ago | 1

| accepted

Answered
Cell manipulation (swapping, combining and converting to an array)
Another option, assuming that there's always a non-zero value on the diagonal (or the whole row is 0): [col_ind, row_ind, v...

10 years ago | 1

Answered
How do I separate RBG channel then combine green and blue channel only, leaving the red channel out? Thanks!
Well, you certainly can manipulate the image pixels using only two colour channels: GB = RGB(:, :, [2 3]); %two channel pi...

10 years ago | 0

Answered
Matrix multiplication with three level loops
You do have a choice about the storage, it was your choice to rearrange your |A| matrix with all these 0. The problem is at ...

10 years ago | 0

Answered
how to multiply certain numbers in a matrice
You haven't explain what _certain numbers_ mean. At a guess: A(A == 1) = A(A == 1) * 2;

10 years ago | 1

Answered
how to convert a table to vectors where each vector takes the name of the column in the table
Assuming you're are talking about matlab <https://www.mathworks.com/help/matlab/tables.html tables>. What would be the advantage...

10 years ago | 1

| accepted

Answered
Creating multiple equally sized matrices from a single numerical cell
Matlab, since R2014b, has had tools to allow reading in chunks files that are too big to fit in memory. Why not use these? See <...

10 years ago | 1

Answered
How to convert binary elements of a cell into decimal number
Question: Why is the data in a cell array when a normal matrix would work just as well and make the code simpler? That is instea...

10 years ago | 0

Answered
extract cell depend on vector?
The latest explanation is much clearer: a = [ 3 2 1 3 6 5 4 6]; b = { [1 2 3] [ 3 6] [ 5 6 7] [ 5 60] [ 5 6 5] [ 6 7 1 0...

10 years ago | 1

| accepted

Answered
How to call a certain part of a matrix which is a value of a field of a structure?
Your description is really not clear. An example would help. Get 2nd and 3rd column of matrix stored in field |'B'| of struct...

10 years ago | 1

| accepted

Answered
Matlab not accessing microsoft project applications
After testing on a computer with MS project installed, it would appear that matlab does not 'see' the interface methods, propert...

10 years ago | 1

| accepted

Answered
incorrect or unexpected brackets
Well, yes, the |(end, :)| can only work as indexing so should follow the name of a variable but comes after a |;|. On top of ...

10 years ago | 2

Answered
How to arrange one row vector into a row x column matrix?
M_new = [reshape(M, 34, 62); zeros(2108, 62)]; M_new = reshape(M_new(1:end-2108), 2108, [])' No need for a loop. Howe...

10 years ago | 1

| accepted

Answered
Looping Over Cell Array with if statements
The first issue is that you've called your variable |cell| which will prevent you from using the function <https://www.mathworks...

10 years ago | 1

Answered
Calling a Field of a Struct by a Pre-defined String Variable
<https://www.mathworks.com/help/matlab/matlab_prog/generate-field-names-from-variables.html generate field names from variables>...

10 years ago | 3

| accepted

Answered
Binary file reader using fread function
I'm not sure you're going to get very far if you can't understand the simple code your posted with the help of the documentation...

10 years ago | 0

Answered
How to get indices of unique elements in matrix in separate arrays
Another option, if you have the image processing toolbox, and assuming all the values in A and M are strictly positive integers:...

10 years ago | 1

Answered
How can I make a square matrix with a nested for loop?
The best way to create that matrix is not to use a loop, but simply: sidelength = 4; si = toeplitz(2.^(0:sidelength-1))

10 years ago | 1

Answered
Create variables from xlsx-file.
Matlab has had <https://www.mathworks.com/help/matlab/ref/readtable.html |readtable|> for over two years now. It's a lot more p...

10 years ago | 0

Answered
Manually specified BinCounts and BinEdges in histogram does not work?
You really ought to look at the <https://www.mathworks.com/help/releases/R2015a/matlab/ref/histogram.html documentation that com...

10 years ago | 0

| accepted

Answered
I am writing a script to convert decimal to floating point binary IEEE754. However, my answer returned number binary values (e.g. 1009999900).
You cannot acurately store a decimal number greater than <https://www.mathworks.com/help/matlab/ref/flintmax.html |flintmax|> (~...

10 years ago | 1

| accepted

Answered
Writing jpg to cell range in excel
My suspsicion is the 1 should be -1. As per the documentation of <https://msdn.microsoft.com/en-us/library/office/ff860737.aspx ...

10 years ago | 0

| accepted

Answered
the first Position of the same values find
A = [3 3 3 3 0 0 3 3 3 3 0 0 0 3 3 3 3 0 3 3 3 3]; loc = find(A == 3); startruns = loc(find(diff([-1 loc]) > 1)) %-1 co...

10 years ago | 0

| accepted

Load more