help-octave
[Top][All Lists]
Advanced

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

Having trouble creating an array with these conditions


From: StudentinCrisis
Subject: Having trouble creating an array with these conditions
Date: Thu, 15 Dec 2011 22:06:34 -0800 (PST)

I'm supposed to create an array that uploads a .dat file. For example

numbers.dat has the following content:
6
0.5
2
3 3 5
1 1 4

6 is the width, 0.5 is the initial case and 2 is the number of sources, 3 3
5 indicates 3rd row and 3rd column should be filled with 5 and 11 4
indicates 1st row 1st column should be filled with 4

So for example (ignore the brackets):

[4.0000 0.5000 0.5000 0.5000 0.5000 0.5000]
[0.5000 0.5000 0.5000 0.5000 0.5000 0.5000]
[0.5000 0.5000 5.0000 0.5000 0.5000 0.5000]
[0.5000 0.5000 0.5000 0.5000 0.5000 0.5000]
[0.5000 0.5000 0.5000 0.5000 0.5000 0.5000]
[0.5000 0.5000 0.5000 0.5000 0.5000 0.5000]

I need to something to work with, I'm supposed to use this function:
function out = initGroup(grid, source1, source2, source3, source4). Any
ideas? I need some kind of direction. 




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Having-trouble-creating-an-array-with-these-conditions-tp4203471p4203471.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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