Message Boards Message Boards

Plot auto-extracted sub-matrices?

Posted 7 years ago

I have a 70x16 matrix ("DATA22K") in which the first column represents time, and the next 15 columns represent trials of a timecourse assay I've performed (n 1 thru 15). I would like to quickly create 15 submatrices with time (col 1) plotted against the values for each trial, each having iterated names of the format "Tr22Ki" (where i = 1 - 15). This is the code I'm using to generate the table of matrices (which seems to work):

Table[Evaluate[Symbol["Tr22K" <> ToString[i]]] == 
Transpose[{DATA22K[[All, 1]], DATA22K[[All, i]]}], {i, 2, 15, 1}];

THE PROBLEM: I used to be able to generate a graph with all Tr22Ki traces superimposed over each other with this code:

ListLinePlot[Tr22Ki]

but it no longer works (blank graph), and I can't figure out why. There is no error code, but I've checked, and all the matrices have been made. The same happens when I write the code as:

Tr22Kall=Table[Evaluate[Symbol["Tr22K" <> ToString[i]]] == 
Transpose[{DATA22K[[All, 1]], DATA22K[[All, i]]}], {i, 2, 15, 1}];
ListLinePlot[Tr22Kall]

Please help! Thank you for your time.

POSTED BY: Jesse Martin
2 Replies
Posted 7 years ago

Hi, Thanks for the quick response. This as actually throwing a series of errors:

  • Set::setraw: Cannot assign to raw object 0.
  • Set::setraw: Cannot assign to raw object 1.010969095`.
  • Set::setraw: Cannot assign to raw object 0.11`.
  • General::stop: Further output of Set::setraw will be suppressed during this calculation.

And it still won't graph. Thoughts?

POSTED BY: Jesse Martin

Hi Jesse,

you are using double equal, "==" (i.e an equality check) instead of single equal "=" (i.e an assignment) so nothing gets assigned to the Tr22K-i variables.

Try

Table[Evaluate[Symbol["Tr22K" <> ToString[i]]] = 
  Transpose[{DATA22K[[All, 1]], DATA22K[[All, i]]}], {i, 2, 15, 1}]

Instead

POSTED BY: Patrik Ekenberg
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract