[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Print column vectors with different sizes

From: Bernd Heinze
Subject: Print column vectors with different sizes
Date: Mon, 27 Feb 2012 21:15:13 +0000 (GMT)


I've got the following problem, but wasn't able got find a solution so far:

A program analyses some data and prints out the results as csv-files which 
contain one column vector with arbitrary size. I want to write a script which 
reads some of the csv-files (using wildcard input and globs() ) and prints the 
vectors into one new csv-file, while the heading contains the filename

#Input from first file:
a = [1;2;3];
filename = "aaa";

A = [A, a];
file = strcat(file, ",", filename);

#Input from second file:
a = [1;2;3;4;5];
filename = "bbb";

A = [A, a]; # Here the error occurs

file = strcat(file, ",", filename);

When I do it like this I get the error that the size of the matrix doesn't 
match. Resizing the matrix and padding it with 0 isn't an option as it would 
give wring results in the later run. I found the "append" option for csvwrite, 
but it only works with appending lines, not with appending columns.

Has anybody an idea how to print columns with different lengths into an 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]