[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: reading data stored in a file: to Jordi
From: |
John W. Eaton |
Subject: |
Re: reading data stored in a file: to Jordi |
Date: |
Fri, 9 Jul 2010 17:30:30 -0400 |
On 9-Jul-2010, Jordi Gutiérrez Hermoso wrote:
| On 9 July 2010 14:21, Nibalart <address@hidden> wrote:
| > your first line works if I erase the word file. From the display I
| > understand that everything is stored in a matrix. When I run the second line
| > the answer is:
| >
| >>>> [v1 v2 v3 v4 v5] = [v(:,1) v(:,2) v(:,3) v(:,4) v(:,5)]
| >
| > error: invalid number of output arguments for matrix list
|
| Sorry, as Jaroslav pointed out, that was a mistake. I've been coding
| in Python recently, and got my wires crossed. You'll have to do
| instead v1 = v(:,1); v2 = v(:,2); v3 = v(:,3) and so on.
Or:
[v1, v2, v3, v4, v5] = deal (v(:,1), v(:,2), v(:,3), v(:,4), v(:,5));
jwe