Help With Matlab - GM Forum - Buick, Cadillac, Chev, Olds, GMC & Pontiac chat


Lounge For casual talk about things unrelated to General Motors. In other words, off-topic stuff. And anything else that does not fit Section Description.

Reply
 
 
 
Thread Tools Search this Thread
Old 01-12-2007, 02:40 PM   #1
Darrel
Guest
 
Posts: n/a
Default 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.
  Reply With Quote
Old 01-12-2007, 02:46 PM   #2
Darrel
Guest
 
Posts: n/a
Default

Here are the images.
Name:  CIT222images.jpg
Views: 0
Size:  11.9 KB

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.
  Reply With Quote
Old 01-12-2007, 03:50 PM   #3
Senior Member
Posts like a Northstar
 
Join Date: Apr 2004
Posts: 606
Thanks: 0
Thanked 0 Times in 0 Posts
Chinski is on a distinguished road
Default

I did not know Matlab could create images (well, besides graphs). Or do you just need a matrix to represent each one? With 1'* and 0'* maybe.
Chinski is offline   Reply With Quote
Old 01-12-2007, 04:11 PM   #4
Senior Member
Posts like a Northstar
 
Join Date: Apr 2004
Posts: 606
Thanks: 0
Thanked 0 Times in 0 Posts
Chinski is on a distinguished road
Default

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.
Chinski is offline   Reply With Quote
Old 01-12-2007, 05:41 PM   #5
Senior Member
True Car Nut
 
95naSTA's Avatar
 
Join Date: Feb 2003
Location: Philly
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
95naSTA is on a distinguished road
Default

I have used matlab a bunch but never to do what your trying to do.

I'm looking it up right now in my matlab text. What version are you working with?
95naSTA is offline   Reply With Quote
Old 01-12-2007, 05:43 PM   #6
Senior Member
Posts like a Corvette
 
Join Date: Sep 2004
Location: Pittsburgh PA
Posts: 1,539
Thanks: 0
Thanked 0 Times in 0 Posts
Puddy46 is on a distinguished road
Default

Always used it for Math/Engineering purposes as well.
Have a book too, so you have 2 options now
Puddy46 is offline   Reply With Quote
Old 01-12-2007, 06:53 PM   #7
Senior Member
True Car Nut
 
95naSTA's Avatar
 
Join Date: Feb 2003
Location: Philly
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
95naSTA is on a distinguished road
Default

I'm still looking stuff up. For the first two it seems like you can use the pcolor function. I'm not sure about the fading images yet though.
95naSTA is offline   Reply With Quote
Old 01-12-2007, 07:09 PM   #8
Darrel
Guest
 
Posts: n/a
Default

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.
  Reply With Quote
Old 01-12-2007, 07:11 PM   #9
Darrel
Guest
 
Posts: n/a
Default

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.
  Reply With Quote
Old 01-12-2007, 07:38 PM   #10
Senior Member
True Car Nut
 
95naSTA's Avatar
 
Join Date: Feb 2003
Location: Philly
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
95naSTA is on a distinguished road
Default

I couldn't really find anything.
Here is the pcolor function I mentioned.
95naSTA is offline   Reply With Quote
 
 
Reply

Related Topics
Thread Thread Starter Forum Replies Last Post
HELP HELP HELP-Did Pep Boys Damage Bonnie?? mprather 1992-1999 24 02-03-2010 08:21 AM
HELP HELP HELP, EXPERTS PLEASE !! statusplease 1992-1999 8 03-15-2008 06:49 PM
palm help (plz any help is good help) gojo83 Lounge 2 09-24-2007 10:34 PM
Back Three Plug wires NOT Coming off HELP HELP HELP VanFaasenC 2000-2005 1 10-04-2006 02:51 PM
Photoshop help! (FONT help now!) willwren Lounge 13 09-16-2003 03:34 PM


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 02:23 AM.


We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.