Color theme
0 day streak0 XPP1
JuliaLearn mode
MISSION 1 OF 1

Read a pixel from a grid

0 XP earned
Julia track: IntermediateMission: BeginnerMatricesTwo-dimensional indexingOne-based indexes
Before you start this intermediate track

Numeric arrays and functions. Work with ranges, broadcasting, and matrix coordinates.

Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.

x
0 / 2 challenges
LEARN THE CONCEPT

Understand it, then try it.

Spaces separate columns and semicolons separate rows in a Julia matrix literal. Two indices then select a cell: the row comes first and the column second. Both start at 1 for this standard matrix. Keeping those positions in named variables makes the intended pixel easy to follow.

array_lab.jl
pixels = [4 9 2; 7 1 46]row = 2column = 3println(pixels[row, column])

Each mission is a standalone Julia 1.x script using Base. Arrays use their standard one-based indices. Run a single snippet with julia; no packages or input files are required.

Track the values line by line. Predict the result before running this example in your own editor.