To talk on Icrontic, just register!

It only takes 30 seconds.

Have an account? Sign in:

Forgot?
mypeace
New to the neighborhood
mypeace
4 Posts

Please, Need help on MATLAB!!!!!!!!!

Write a script/function that does the following:

It takes a matrix, of arbitrary size (m x 1, 1 x n, or m x n), and computes an output matrix of identical size.

The i, jth element of the output is equal to the sum of all the surrounding elements of the i, jth element of the input matrix.

For elements on the edge and corner of the input matrix there will be fewer elements to add.

Examples:

[1 0] --------> [0 1]





[1 0; -----------> [1 2;
0 1] -----------> 2 1]





[0 0 0; ---------------> [1 1 1;
0 1 0; ---------------> 1 0 1;
0 0 0] ---------------> 1 1 1]
shwaip
elaborate bot
shwaip
5,729 Posts
If I do your homework now, how do you expect to pass tests?
Similar Threads
Thread Thread Starter Forum Replies Last Post
Matlab help on Financial Estimation!!? deaconblues Matlab Help 2 29 Aug 2008 1:42pm
Batch-processing in MATLAB geodave Matlab Help 6 18 Jul 2008 12:58am
Writing new files from Matlab raulinhoo Matlab Help 6 5 Jun 2008 8:31pm
Closing external programs in matlab raulinhoo Matlab Help 2 4 Jun 2008 3:55pm

Go Back   Icrontic Forums > Tech: Software > General Software > Matlab Help
Jump to
This Thread Search this Thread
Search this Thread:

Advanced Search


Current time: 8:28pm (GMT)
Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Get Vanilla instead. Trust me.