N-Dimensional Array Slice - MATLAB Cody - MATLAB Central

Problem 375. N-Dimensional Array Slice

Difficulty:Rate

Given an N-dimensional array, A, an index, I, and a dimension, d, return the I th elements of A in the d dimension.

For Example,

    array_slice( A, 5, 3 )

is equivalent to

    A(:,:,5)

Note: eval and str2func cannot be used. This is a Cody restriction.

Solution Stats

22.78% Correct | 77.22% Incorrect
Last Solution submitted on Mar 16, 2025

Problem Comments

Solution Comments

Show comments

Group

Project Euler II Image
Project Euler II
  • 12 Problems
  • 51 Finishers

Problem Recent Solvers232

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page