Rank: 7379 based on 10 downloads (last 30 days) and 1 file submitted
photo

Catalin Serban

E-mail

Personal Profile:

Student in UPB bucharest

Professional Interests:
programmer

 

Watch this Author's files

 

Files Posted by Catalin
Updated   File Tags Downloads
(last 30 days)
Comments Rating
11 Jan 2012 Band matrix generation Generates a band matrix Author: Catalin Serban band matrix 10 2
  • 1.0
1.0 | 1 rating
Comments and Ratings on Catalin's Files View all
Updated File Comment by Comments Rating
13 Jan 2012 Band matrix generation Generates a band matrix Author: Catalin Serban Fig, Matt

Caitlin, why did you submit two identical files? Did you do this by mistake, perhaps?

Also, you really should at least familiarize yourself with the ONES function in MATLAB, it would be most useful in your function...

11 Jan 2012 Band matrix generation Generates a band matrix Author: Catalin Serban Hanselman, Duane

Start with a matrix of zeros, change all the values to 1 individually through a nested for loop, then use another nested for loop to change some of them back to zeros.
The author at least deserves credit for preallocating memory.
This is why so much effort was put into implementing JIT.

Here is the entirety of what is in this file:

function [G]=bandmatrix(n,k1,k2)
G=zeros(n,n);
for i=1:n
for j=1:n
G(i,j)=1;
end
end
for i=1:n
for j=1:n
if (j<i-k1) G(i,j)=0;
end
if(j>i+k2) G(i,j)=0;
end
end
end

Contact us