Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question

1 Answer

up vote 7 down vote accepted

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

share|improve this answer
Would it be possible to make the above manipulate interactive a la .cdf? – WalkingRandomly Dec 2 '12 at 18:34
wow, thanks for your prompt answer! – Dennis Yurichev Dec 2 '12 at 18:52
@WalkingRandomly yes, definitely. Using Top Menu >> Deploy >> ... – Vitaliy Kaurov Dec 2 '12 at 19:53
@Vitaliy Yes I know that :) What I meant was 'why not do it in this answer?' – WalkingRandomly Dec 2 '12 at 19:58
2  
@WalkingRandomly, it is not possible to embed the CDF itself as an answer. I think only images (and animated gif files) can be uploaded. May be someone can correct if I am wrong. – Nasser Dec 2 '12 at 20:04
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.