[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: xlim gives memory exhausted error when used after plotting (v3.4.3 M
From: |
Ben Abbott |
Subject: |
Re: xlim gives memory exhausted error when used after plotting (v3.4.3 MinGW Windows) |
Date: |
Thu, 09 Feb 2012 08:32:20 -0500 |
On Feb 9, 2012, at 7:43 AM, Bernhard Weller wrote:
> I encounter a problem, which I didn't using 3.4.2 MinGW.
>
> It's a bit strange as I was not able to recreate the problem using a simple
> example, but only with my measured values.
>
> The m-file as well as the data is available from my website (don't know how
> big a file attachment is allowed to be):
> http://arsenal-of-wisdom.org/downloads/xlimerror.zip (~40 kB)
>
> My code is pretty straightforward (after narrowing it down):
> clear; close all;
> load xlimerror.mat
> figure(1); clf;
> hold on
> semilogx(EstF, 20*log10(EstMag), 'b-')
> xlim([minF maxF])
>
> The error is related to the xlim([minF maxF]) line and says:
> error: memory exhausted or requested size too large for range of Octave's
> index type -- trying to return to prompt
>
> So something inside xlim goes wrong - my data is only a tiny 2623x1 for x
> and y. And a total of 42kB used memory.
>
> I noticed that if I place the xlim line before the plot command I don't get
> an error message.
> Is it required to put xlim before the plot commands?
Your example works for me on MacOS, so it may be tricky to determine what is
wrong.
You array size only consumes 20984 bytes, so I doubt you've exhausted your
memory. But please run the example below to be sure.
clear all
close all
figure (1)
clf
hold on
semilogx (rand (10000,1))
xlim ([[1040.3, 1090.4]])
Does the problem persist if you quit and restart Octave ?
What if you reboot Windows ?
Are "clf" and "hold on" necessary to produce the problem ?
If you don't include the xlim() statement in your script does it run ok? Does
it then fail if you type it at the command line ?
I noticed the xrange is 1040.3 to 1090.4. Maybe there is something about using
a log scale with such a narrow range of data?
What does the following do ?
clear
close all
figure (1)
clf
hold on
semilogx ([1040.3, 1090.4], 20*log10([0.029369, 23.101]))
xlim ([[1040.3, 1090.4]])
If that also fails, then try ...
clear
close all
figure (1)
clf
hold on
set (gca, "xscale", "log")
xlim ([[1040.3, 1090.4]])
If neither have a problem then, try
clear
close all
figure (1)
clf
hold on
plot (EstF, 20*log10(EstMag))
xlim ([[1040.3, 1090.4]])
Ben