1. ## MATLAB programme

Hi,

I'm pretty new with matlab programming. Perhaps someone could help me with the following:

"Let D be an N×N matrix. The element d
ij (i=1,…,N;j=1,…,N) of D is 1 if the sum of all the
elements of the Pascal matrix of order i equals the sum of all the elements of Magic matrix of
order j, and 0 otherwise. Write a Matlab programme that constructs D and that counts the

number of ones in D for N is 100."

kind regards,

Moljka

2. ## Re: MATLAB programme

Originally Posted by moljka
Hi,

I'm pretty new with matlab programming. Perhaps someone could help me with the following:

"Let D be an N×N matrix. The element d
ij (i=1,…,N;j=1,…,N) of D is 1 if the sum of all the
elements of the Pascal matrix of order i equals the sum of all the elements of Magic matrix of
order j, and 0 otherwise. Write a Matlab programme that constructs D and that counts the

number of ones in D for N is 100."

kind regards,

Moljka
Start by writing functions PascalSum(i) that calculates the sum of all the elements of the Pascal matrix of order i, and MagicSum(j) that calculates the sum of all the elements of Magic matrix of order j.

CB