help-octave
[Top][All Lists]
Advanced

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

R: R: help on Octave


From: Pierpaolo
Subject: R: R: help on Octave
Date: Fri, 29 Jun 2012 12:33:50 +0200

Hi, 

I created the sparse matrix and sparse array by

s=speye(3*dd);  
d=speye(3*dd,1);

This because I don't know how to create an empty sparse matrix:

w=s-s;   
jj=s-s;
fe=d-d;

Then I fill the matrix by several for loop like this:

function jac=fja(x)
jac=2/(1-x)^3;
endfunction

for j=1:(dimytot-4) 
        for i=1:(dimxtot-4) 
        
jj((j+1)*dimxtot+(i+2),(j+1)*dimxtot+(i+2))=feval("fja",vp((j+1)*dimxtot+(i+
2)));
        endfor
endfor


[L,U]=lu((w-jj));

err=U\(L\(fe-w*vp));

>“warning: matrix singular to machine precision, rcond = 1
>
> warning: attempting to find minimum norm solution”

Thanks

Pierpaolo


-----Messaggio originale-----
Da: Martin Helm [mailto:address@hidden 
Inviato: mercoledì 27 giugno 2012 16:29
A: Pierpaolo
Cc: address@hidden; 'Nicholas Jankowski'
Oggetto: Re: R: help on Octave

Am 27.06.2012 16:15, schrieb Pierpaolo:
>
> Hi,
>
> I followed your advice and now, using sparse matrix, I saved a lot of
> memory.
>
> But now with sparse matrix I get
>
> “warning: matrix singular to machine precision, rcond = 1
>
> warning: attempting to find minimum norm solution”
>
> evaluating this code:
>
> [L,U]=lu(A);
>
> C=U\(L\(B));
>
> where A,B are sparse matrix
>
> What does it mean?
>
> With A,B full matrix I have not this warning
>
> Thanks a lot
>
> Pierpaolo
>
It means what it says the matrix is not of full rank.
Maybe you made an error when assembling the sparse matrix, can you show
the part of the code you use now to create A?




reply via email to

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