help-octave
[Top][All Lists]
Advanced

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

## Re: a difficult homework

 From: Nicholas Jankowski Subject: Re: a difficult homework Date: Mon, 26 Aug 2019 15:25:37 -0400

On Sun, Aug 25, 2019 at 12:27 AM shivax via Help list for GNU Octave <address@hidden> wrote:
hi nrjank , thank you for answer

i found this solution :
(i try to use matrix this large matrix but the PC stops me for lack of
memory...i use pc portable intel i-5 with 8 giga Ram )

a1=fix(rand(225).*100);
a=a1(:);
b=1:50624;
b=b';
c=(1:50624)+1;
c=c';

cc=a.*ones(1,numel(b));

%d=cc(b:end)
g=(1:rows(cc))'.*ones(1,numel(b));
g1=g>=b&g<=c;

e=min(~g1.*max(cc).+g1.*cc)

Since you're only dealing with integers between 0 and 100, if you change the first line to:

a1 = int8(rand(225).*100);

you will significantly decrease the memory required. again, later,
g=(uint16(1:rows(cc)))'.*ones(1,numel(b));

you can use the 'whos' command to see the variable memory usage.
cc      50625x50624             2562840000  int8
g       50625x50624             5125680000  uint16

this gets to your next line which produces an error:

>> g1=g>=b&g<=c;
error: mx_el_ge: nonconformant arguments (op1 is 50625x50624, op2 is 50624x1)

so you should re-examine what you're trying to do there.

reply via email to

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