Help With Matlab
#1
Guest
Posts: n/a
Help With Matlab
Does anyone have any expirence with Matlab? I have to use this program for one of my Lab assignments to create some simple graphics using a matrix. They are simple 100x100 images and only black and white (some fade from black to white so they would include a lot of grays). I'll post pictures of the images in a minuet... as soon as i get them onto photobucket.
#2
Guest
Posts: n/a
Here are the images.
CIT222images.jpg
each square that is, not one as a whole... i'm just wonderin if anyone can offer any hints as to how i create a matrix that would show these. Thanks guys.
CIT222images.jpg
each square that is, not one as a whole... i'm just wonderin if anyone can offer any hints as to how i create a matrix that would show these. Thanks guys.
#4
Senior Member
Posts like a Northstar
Join Date: Apr 2004
Posts: 606
Likes: 0
Received 0 Likes
on
0 Posts
I did some quick searching, Matlab uses the colors 0 through 255. 0 being the lightest, 255 being the darkest. Your matrix is the pixels. So if you draw a 5x5 grid on the first one the matrix would be like: [255 255 255 255 255; 255 0 0 0 255; 255 0 0 0 255; 255 0 0 0 255, 255 255 255 255 255] Just have to follow suit for the rest, figuring out what numbers represent the shades for the gray-scale ones. I'd use random shades of gray or random black/white for the last one. I do not remember the code exactly, but you might be able to write a formula to fill the matrix randomly for the last one.
#8
Guest
Posts: n/a
well i know that its all done by something like this
>>A=zeros(100,100)
>>imshow(A)
That code will (should ) give you a 100 by 100 black box.
i just need to figure out how to make the white one for instance, or fade from black to white accross the square. I don't know how else to do it other then manually type it in but the proff said that we can't do that.
>>A=zeros(100,100)
>>imshow(A)
That code will (should ) give you a 100 by 100 black box.
i just need to figure out how to make the white one for instance, or fade from black to white accross the square. I don't know how else to do it other then manually type it in but the proff said that we can't do that.
#9
Guest
Posts: n/a
Oh, I should have mentioned too, that I think its the newest version but i don't know the number. and i won't have access to the program again untill monday night or tuesday afternoon. i am just trying to figure out what i can try when i do get a chance to get into the computer labs.