Question

Match names from two different columns - Comparing strings of different lengths

I have a cell variable A with about 4000 rows and 5 columns: C1 c2 c3 c4 c5 A={1...

6 years ago | 2 answers | 0

Question

Append column given a 'year' condition

I have a cell type variable A with 30000 rows and 29 columns, for example: b1 *b2* b3 b4 b5 b6 ...

6 years ago | 2 answers | 0

Question

Error when introducing dummy variables in a regression

I am running the following regressions in Matlab: tbl1=table(Y1,X1); mdl1=fitlm(tbl1,'Y1~X1'); mdl12=fitglm(tbl1,'Y...

6 years ago | 0 answers | 0

Question

New variable based on a 'percentile' condition

I have a double variable A with 6000 rows and 3 columns: * C1 gives the year; * C2 gives a code (no repetitions within each ...

6 years ago | 2 answers | 0

Question

Group values in a double & create new matrix according to the groups formed

I have a double variable A with 1 column and 30000 rows: A=[44 12 79 12 83 63 53…] I applied the follo...

6 years ago | 2 answers | 1

Question

Error when applying cell2mat

I have several columns in a cell array A with double values, and I am applying this very simple formula to get separate variable...

6 years ago | 2 answers | 0

Question

Substitute blank entries by 1 or 0 in a column of a cell given a condition.

I have a double variable A with 3 columns and 90000 rows, sorted first by a1(year) and then by a2 (code); and a cell variable B ...

6 years ago | 1 answer | 0

Question

Get new Double Matrix from Data on a Cell Array

I have a cell variable with 13000 rows and 11 columns. For instance: C1 c2 c3 c4 c5 c6 c7 ...

6 years ago | 1 answer | 0

Question

Convert logical values into numeric values

I have a cell array 20000 rows and 20 columns with logical values: A={0 0 0 0 1 0... 0 0 1 0 0 0 1 0 0 0 0 0 ...

6 years ago | 4 answers | 2

Question

Append new column considering the distribution of the elemnts in a column

I have a cell type variable with 20000 rows and 9 columns. For example: c3 A={ 4197 0 53,0 15 2...

6 years ago | 1 answer | 0

Question

Regression with several dummy variables

I have a cell type variable with 20000 rows and 700 columns. I present here an example of the first 9 columns: C1 C2 ...

6 years ago | 1 answer | 0

Question

Append new column to a cell with zero & one values

I have a cell type variable with thousand rows and 8 columns. For example: c3 A={ 12 0 69.11 13...

6 years ago | 3 answers | 0

Question

Create dummy variables from elements of a cell

I have a cell type variable X with 100 rows and 8 columns. Here is an example: X={ c1 c2 c3 c4 c5 c6 c7 c8 18 1 53.33...

6 years ago | 1 answer | 0

Question

Place blank entries by zeros

I have a cell type variable with 5000 rows and 8 cells. For example: a={182 1999 63,8 229 [] 30 [] 1 185 1999 44,5 123 1...

6 years ago | 2 answers | 0

Question

Get new variable if a condition verifies in a cell

I have a cell type variable with 4 columns and 500000 rows, sorted by c3 and then by c1. For example: c1 c2 c3 c4...

6 years ago | 2 answers | 0

Question

Sort cell according to one column of the cell

I have a cell type variable A with 500000 rows and 3 columns. See example below: C1 C2 C3 C4 A={19...

6 years ago | 1 answer | 0

Question

Append a column to a cell variable if two conditions verify

I have a cell variable with 7000 rows and 14 columns. There are no repeated rows. Example with only 9 columns: A={1994 1440...

6 years ago | 1 answer | 0

Question

Substitute blank entries in a cell array by elements from a double matrix

I have a cell type variable A with 500 rows and 3 columns: c1 y v c1 c2 c3 A={13 1999 47,7 1...

6 years ago | 2 answers | 0

Question

Get new variable based on a condition

I have a double variable with 3 columns and 60000 rows, sorted by c2 and then by c1. For example: c1 c2 c3 ...

6 years ago | 3 answers | 0

Question

Take elements from a cell variable to other based on a condition

I have a cell type variable A with 8 rows and 500 columns: code1 year value code1 *code2* A={ 1037 1999...

6 years ago | 1 answer | 0

Question

Find unique combinations of double and character elements

I have a cell type variable with 3 columns and 500000 rows, here is an example: c1 c2 c3 A={1994 'AACE' 2071 ...

6 years ago | 3 answers | 0

Question

Efficient application of unique and strcat functions

I use the following code on several occasions to keep only the rows with the condition that X elements don't repeat: [~, in...

6 years ago | 1 answer | 0

Question

Track changes in the rows to get a new variable in Matlab

I have a double variable called 'change2' with 3 columns and 40000 rows. The variable is sorted by c2 and then date (c1). ...

6 years ago | 1 answer | 0

Question

Error when computing the mean in Matlab

I have a double variable called Num_Firm_An with 3 columns and 60000 rows. Num_Firm_An=[1994 12 19 1994 13 16 1994 16...

6 years ago | 1 answer | 0

Question

Erase row based on a specific condition in Matlab

I have a cell array with 10000 rows and 7 columns. A={ 701 1999 53,7 701 407 31 18 702 1999 39,6 [] [] [] [] 729 1999...

6 years ago | 1 answer | 0

Question

Create new variable if elements of different variables match in Matlab

I have 3 cell arrays: A that has 3 columns and 5000 rows. B that has 5 and 60 columns. C that has 4 columns and 500 rows. Sample...

6 years ago | 2 answers | 0

Question

Check for repeated values in two cell arrays in matlab

I have 2 cells with 5 columns and I want to verify whether there are no repetitions in the values of the 1st columns. For exampl...

6 years ago | 1 answer | 0

Question

Compute average of a column in a cell without considering NaN values

I have a cell array with 3 columns and 130000 rows: A={56276 2009 '-' 56278 2009 NaN 56281 2009 NaN 56285 2009...

6 years ago | 3 answers | 0

Question

Count elements of a cell array based on two conditions

I have the following cell array: A={'x' 2000 [] 2001 [] 26 61 21 157 104 41 98 18 76 60 125 2...

6 years ago | 3 answers | 0

Question

How to erase rows with blank entries with one exception?

I have this code that erases all the rows if there is a blank entry [ ] in any of the columns/rows of the cell array: ...

6 years ago | 1 answer | 0