Answered
How to compute all permutation of cell array where each cell is a list
The simplest solution is to download Jos' excellent <https://www.mathworks.com/matlabcentral/fileexchange/10064-allcomb-varargin...

9 years ago | 0

| accepted

Answered
How to choose number of decimal places
Don't worry, MATLAB has not eaten your digits! You should not confuse how data is _displayed_ with how data is _stored_ in memor...

9 years ago | 0

| accepted

Answered
Can someone help me explain the meaning of the matrix "720 x 1285 x 3. I need to know the intent of the number 3 behind the matrix above if I input the image and display it in the workspace on matlab
Probably you have an RGB image. RGB images are most commonly stored as a 3D array of values, where the third dimension encode ea...

9 years ago | 0

| accepted

Answered
type if x is a square matrix statement
funcz = ~diff(size(x))

9 years ago | 1

Answered
Get data from multi-level struct using strings
You can use <https://www.mathworks.com/help/matlab/ref/setfield.html |setfield|> and <https://www.mathworks.com/help/matlab/ref/...

9 years ago | 2

| accepted

Answered
Problem reading the csv file with dlmread command.
The file has a header. You need to specify that the range does not include the header: >> M = dlmread('ff3all.csv',',',1,0)...

9 years ago | 0

Answered
How to remove data in a column below the first non-zero
This is MATLAB, so you do not need to write ugly code using lots of loops, |find|, and |if|'s as if this was a low-level languag...

9 years ago | 3

Answered
how can I find the maximum value in each row of a matrix and sum along the column then assign the values to another matrix
All you need is <https://www.mathworks.com/help/matlab/ref/max.html |max|> and <https://www.mathworks.com/help/matlab/ref/accuma...

9 years ago | 1

| accepted

Answered
How to replace elements in an array with the indices of the array's sorted, unique values?
All you need is the third output of |unique| followed by |reshape|: >> [~,~,Y] = unique(A); >> reshape(Y,size(A)) For...

9 years ago | 0

| accepted

Answered
i need help replacing the integers in this file.
First a few notes: * Processing numeric data that is encoded in character arrays is quite inefficient, and makes the code com...

9 years ago | 0

Answered
I am trying to divide and getting the error message "matrix dimensions must agree". What does this mean?
You need to use element-wise <https://www.mathworks.com/help/matlab/ref/rdivide.html |rdivide *./*|>, not matrix <https://www.ma...

9 years ago | 0

Answered
cumulative sum in matrix
cumsum(rand(5,10),1)

9 years ago | 0

| accepted

Answered
How to Pad an Array with extra zeros
Here are some simple methods that automatically adjusts to the length of the vector: *Method One: pad to end of vector:* ...

9 years ago | 1

| accepted

Answered
'Not enough input arguments' error with arrayfun
The arrayfun documentation states that its first input argument must be a function handle: https://www.mathworks.com/help/matla...

9 years ago | 2

Answered
How to do xor operation?
Ugly loops are not required, this is all you need: >> x = {'1' '1' '1' '0' '1' '1' '0' '1'}; >> v = {'1' '1' '0' '0' '1'...

9 years ago | 2

Answered
how to make function that sometimes return output and how to call
*Simplest solution: set a default output value:* function [a,b] = myfn(x,y) a = 1; b = []; if(x=y) b = 2; ...

9 years ago | 0

| accepted

Answered
Inserting elements of one matrix into another not working?
_"But for some reason, I am not able to concatenate them,"_ You are trying to concatenate arrays of two difference sizes: the...

9 years ago | 0

Answered
Finding minimum value in multi dimensional cell array
Trying to perform numeric operations on a cell array is usually pointlessly complicated, so the first thing to do is to put that...

9 years ago | 0

| accepted

Answered
Help me with indexing please?
There is no point writing MATLAB code as if it were Python (or C++) with lots of loops. MATLAB is a high-level language, so forg...

9 years ago | 0

Answered
can i obtain this vector ?
>> V = 0:5; >> 2*V + mod(1+V,2) ans = 1 2 5 6 9 10 See also: <https://oeis.org/search?q=1%2C2...

9 years ago | 2

| accepted

Answered
Different dimension file between .mat and the information from whos('var') when I save a structure
Mat files are compressed. <https://www.mathworks.com/help/matlab/import_export/mat-file-versions.html> I don't see any rea...

9 years ago | 0

| accepted

Answered
Problem with second axis in subplot
The MATLAB documentation shows how to add a second X-axis along the of the axes: <https://www.mathworks.com/help/matlab/creat...

9 years ago | 1

Answered
repeating a number and then repeating another number using repmat
*Method one: |repmat|:* >> A = [0:1:125 125:-1:0]; >> B = [repmat(82,1,126),repmat(86,1,126)]; *Method two: |gradient...

9 years ago | 1

| accepted

Answered
Get image handle with imshow
_"Why is this happening?"_ Because that is exactly what your version of MATLAB does. All graphics handles prior to R2014b are...

9 years ago | 0

| accepted

Answered
How to split command signal arrays in command order sequence?
Use |mat2cell| and then <https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-cell-array.html cell array indexing>...

9 years ago | 0

| accepted

Answered
how to change the logical type matrix into other type
double(M) where |M| is your logical matrix. For example: >> M = [true,false,true] M = 1 0 1 >> double(M) ...

9 years ago | 0

| accepted

Answered
getting first element of each cell array with different sizes
>> C = {[8,14];[10,14,15];[9,14];[5,14]}; >> cellfun(@(v)v(1),C) ans = 8 10 9 5

9 years ago | 6

| accepted

Answered
Tags in the forum
They have moved to the right-hand side of the page, but they are still visible and editable for me, e.g. for this question: ...

9 years ago | 1

| accepted

Answered
finding the index of a particular point in a matrix.
One simple solution: A = [ 0 5 2 18 8 15 0 1 4 1 1 4 0 2 3 ...

9 years ago | 0

| accepted

Load more