Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Operation count for Choleski factorization and Guass elimination

Subject: Operation count for Choleski factorization and Guass elimination

From: Nancy

Date: 19 Apr, 2013 00:55:09

Message: 1 of 3

Hi, I'm having a lot of trouble finding the multiplication and division operation count for Choleski factorization (without pivoting) and the Gauss elimination.

I had a go at the Choleski factorization, but seem to be getting a lot of errors such as "The expression to the left of the equals sign is not a valid target for an assignment" and a variable is undefined:

function [count] = Chol(j,k,i)

for n=2:50;
for j=1:n;
for k=1:j-1;
for i=j:n;
    d = size(a);
[n,n] = size(a);
[d1,d2,d3,...,dn] = size(X);
a(j:n,j) = a(j:n,j)-a(j:n,1:j-1)*.a(j,1:j-1);
end
end
a(j,j)=sqrt(a(j,j));
for k=j+1:n;
a(j+1:n,j) = a(j+1:n)/a(j,j);
count = n^3/3+n^2-1/n;
end
end
end

I'm not sure if I'm on the right track.
Any help will be appreciated.

Thank you.

Subject: Operation count for Choleski factorization and Guass elimination

From: Steven_Lord

Date: 19 Apr, 2013 15:12:13

Message: 2 of 3



"Nancy " <blue.icy.dragon@gmail.com> wrote in message
news:kkq4ld$qhe$1@newscl01ah.mathworks.com...
> Hi, I'm having a lot of trouble finding the multiplication and division
> operation count for Choleski factorization (without pivoting) and the
> Gauss elimination.

Why are you trying to find this information?

> I had a go at the Choleski factorization, but seem to be getting a lot of
> errors such as "The expression to the left of the equals sign is not a
> valid target for an assignment" and a variable is undefined:
>
> function [count] = Chol(j,k,i)
>
> for n=2:50;
> for j=1:n;
> for k=1:j-1;
> for i=j:n;
> d = size(a);
> [n,n] = size(a);
> [d1,d2,d3,...,dn] = size(X);

This is not valid MATLAB syntax.

*snip*

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Operation count for Choleski factorization and Guass elimination

From: Nancy

Date: 19 Apr, 2013 21:00:09

Message: 3 of 3

What changes could I make to it to make it a valid syntax?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us