From help-request at octave dot org Tue Jan 4 04:41:28 2005 Subject: Re: Error assigning complex values to pre-initated matrix From: Miroslaw Kwasniak To: help at octave dot org Date: Tue, 4 Jan 2005 11:43:51 +0100 On Tue, Jan 04, 2005 at 11:34:29AM +0200, Neilen Marais wrote: > Hi All. > > This seems to me like something that should work: > > measured_data = zeros(data_points,2); > > ## Measure data for line loaded with 100 Ohm > > measured_data(1,:) = [0.0130853 +0.00915463j,\ 1]; # l = 5.2mm In your case octave interprets + as unary operator, use in [] `a+b' or `a + b' but not `a +b' - see below: octave:3> [0.0130853+0.00915463j, 1] ans = 0.01309 + 0.00915i 1.00000 + 0.00000i octave:4> [0.0130853 +0.00915463j, 1] ans = 0.01309 + 0.00000i 0.00000 + 0.00915i 1.00000 + 0.00000i octave:5> [0.0130853 + 0.00915463j, 1] ans = 0.01309 + 0.00915i 1.00000 + 0.00000i Mirek ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------