Hi,(adsbygoogle = window.adsbygoogle || []).push({});

Given that I have say a vector A:

[0,1,2,3,4,5]

How can I use imagesc on this to get a graphic that would resemble a gradient (if you know what i mean, so that 0 is black ... to 5 being white) in a rectangle?

I've tried the simple call imagesc(A) in Octave which definitely works for matrices for me (eg. not m by 1 dimensional or 1 by m dimensional) but it is not working for this and gives me the error:

line 0: Sample period must be positive. Try `flip` for changing direction

Any clues?

Thanks!

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Visualizing arrays using imagesc and Octave

Can you offer guidance or do you also need help?

**Physics Forums | Science Articles, Homework Help, Discussion**