1
$\begingroup$

I got matrix, let's say, 100 rows and I would like to plot only 10-rows window of it.

Is it possible to add a slide control to Manipulate[] window so to shift 10-row "window" interactively?

I trying Manipulate[MatrixPlot[matrix[[x ;; x + 10]]], {x,0,100}], but that's not working.

$\endgroup$
0

1 Answer 1

7
$\begingroup$

Mistakes:

  • Element index starts from 1, not 0
  • Manipulate control x should run with step 1
  • Manipulate control x should run with up to 100 - 10 = 90, other wise you will exceed the max index

Here is a correct version

m = RandomReal[1, {100, 10}];
Manipulate[MatrixPlot[m[[1 + x ;; x + 10]]], {x, 0, 90, 1, Appearance -> "Labeled"}]

enter image description here

$\endgroup$
5
  • $\begingroup$ Would it be possible to make the above manipulate interactive a la .cdf? $\endgroup$ Dec 2, 2012 at 18:34
  • $\begingroup$ wow, thanks for your prompt answer! $\endgroup$
    – user4449
    Dec 2, 2012 at 18:52
  • $\begingroup$ @WalkingRandomly yes, definitely. Using Top Menu >> Deploy >> ... $\endgroup$ Dec 2, 2012 at 19:53
  • $\begingroup$ @Vitaliy Yes I know that :) What I meant was 'why not do it in this answer?' $\endgroup$ Dec 2, 2012 at 19:58
  • $\begingroup$ @WalkingRandomly Nasser is correct. I do not think this site supports java script plug-ins. BTW I replied to your graph comment. I'd be curious to know if you had a chance to try it and if you was able to complete building your huge twitter graph. Thanks for the comments guys ;) $\endgroup$ Dec 2, 2012 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.