[scilab-Users] building vector from data file

Mathieu Dubois mathieu.dubois at limsi.fr
Wed Jul 7 14:17:57 CEST 2010


Hi Peng,
> I have managed to let Scilab read data from file and display them 
> however I like. But, how can I dynamically create vectors out of the 
> data it reads line by line?
I assume that you don't know how many lines are going to be read.

One way to do this is:
1) create an empty vector: v=[]
2) for each line you can append your data with: v($+1) = new_data
$ is the scilab equivalent of matlab end operator. Scilab takes care of 
data allocation and so on...
  It works also with matrices.

As a toy example, look at the attached file.

HTH,
Mathieu

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test_input.sce
URL: <https://lists.scilab.org/pipermail/users/attachments/20100707/3b3bd166/attachment.ksh>


More information about the users mailing list