help-octave
[Top][All Lists]
Advanced

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

RE: Plotting basics


From: Byron Hawkins
Subject: RE: Plotting basics
Date: Fri, 21 Feb 2014 09:27:41 -0800


-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Mike Miller
Sent: Friday, February 21, 2014 9:06 AM
To: Byron Hawkins
Cc: help-octave Octave
Subject: Re: Plotting basics

On Fri, Feb 21, 2014 at 08:58:38 -0800, Byron Hawkins wrote:
>> [...]
>> args = argv();
>> plots = [];
>> for i = 3:length(args),
>>  plot = dlmread(args{i});
>>  plots = [plots;plot];
>> end;
> [...]
>
> Here is the error:
>
> Loading plot #2: data/word-create.ind.v.m Loading plot #3: 
> data/word-create.ind.s0.m Loading plot #4: data/word-create.ind.s1.m
> error: ./generate-plot.m: subscript indices must be either positive 
> integers less than 2^31 or logicals
> error: called from:
> error:
> /stash/experiments/train/word/create/current-merge/chart/generate-plot
> .m at line 21, column 3

You have a variable named "plot" in your script that is overriding the function 
named plot. What looks to you like a function call is actually indexing into 
the plot variable. That's why the error is reported as coming from your script 
and not from inside the plot function. Try renaming the variable plot in your 
for loop and you should get better results.

HTH,

--
Mike



Thank you!!! That was it, and I was definitely never going to figure that out. 
I only program in strongly typed languages that can't swap a function for a 
variable. 

Byron



reply via email to

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