Assigning elements to a matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg47358] Assigning elements to a matrix
- From: Mark Coleman <mark at markscoleman.com>
- Date: Tue, 6 Apr 2004 06:36:57 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Greetings, I need to create a series of n x n matrices, in both conventional and sparse matrix formats. I have a (large) table of lists, where each list is of the form: {i,j,value}, where {i,j} are the row-column indices and value is the corresponding numerical value, i.e., m[[i,j]]=value. Using this data I need to create an n x n matrix where all the values except those specified in my list are 0. I would also like to create a similar matrix, this time using Mathematica's built-in SpareMatrix format. Can anyone suggest a way to do this? Thanks, -mark
- Follow-Ups:
- Re: Assigning elements to a matrix
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Assigning elements to a matrix
- From: Sseziwa Mukasa <mukasa@jeol.com>
- Re: Assigning elements to a matrix