MAT --> CSV with multiple matrices/columns

Continuing the discussion from How to read in CSV file in different format into a MAT file?:

Continuing the discussion from How to read in CSV file in different format into a MAT file?:

Hello! I’ve been finding this example very useful but could you provide an example with more columns/matrices? I’m having an issue where I’m trying to output more than two matrices into a CSV and can’t make it scale.

i.e. I’m trying something like:

MO=1-8, FORMAT=CSV, PATTERN= IJM:V, FIELDS=1,2,3,4,5,6,7,8,9,10
MW[1]=MI.1.69
MW[2]=MI.1.70
MW[3]=MI.1.83
MW[4]=MI.1.84
MW[5]=MI.1.153
MW[6]=MI.1.154
MW[7]=MI.1.167
MW[8]=MI.1.168

Thanks!

Hi gabe,

Attached you will find an example that has two steps. The first is to combine two matrix files into one matrix file with six matrix tables. Each table is a 1246x1246 format. The second step outputs this matrix file to a CSV. You need to be careful when working with such large files because it tends to exceed the row/column limitation of CSV and thus, cannot be opened in Excel. However, a workaround is to open it in Notepad or Notepad++.

Figure 1: Application Overview has two steps: populating an output matrix file with six tables and converting this matrix file to CSV.

Figure 2: Output matrix file with six tables.

Figure 3: Here is the output CSV opened in Notepad. In order from left to right: origin I, destination J, V from MW[1], V from MW[2], …, V from MW[6].

MATtoCSV_MultiMatCol.zip (950.3 KB)