Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 725635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:21:34+00:00 2026-05-14T06:21:34+00:00

I have a 4D array of measurements in MATLAB. Each dimension represents a different

  • 0

I have a 4D array of measurements in MATLAB. Each dimension represents a different parameter for the measurement. I want to find the maximum and minimum value and the index (i.e. which parameter) of each.

What’s the best way to do it? I figure I can take the max of the max of the max in each dimension, but that seems like a kludge.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:21:34+00:00Added an answer on May 14, 2026 at 6:21 am

    Quick example:

    %# random 4 d array with different size in each dim
    A = rand([3,3,3,5]);
    
    %# finds the max of A and its position, when A is viewed as a 1D array
    [max_val, position] = max(A(:)); 
    
    %#transform the index in the 1D view to 4 indices, given the size of A
    [i,j,k,l] = ind2sub(size(A),position);
    

    Finding the minimum is left as an exercise :).

    Following a comment:
    If you do not know the number of dimensions of your array A and cannot therefore write the “[i,j,k,l] =” part, use this trick:

    indices = cell(1,length(size(A)));
    
    [indices{:}] = ind2sub(size(A),position);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have array unknown size i want to transfer to matrix[n][2].Example; D[c]=1,2,3,4,5 D[c/2][2]= 1
I have array of select tag. <select id='uniqueID' name=status> <option value=1>Present</option> <option value=2>Absent</option> </select>
I have array of strings, String[] data and it's 10 elements has value P
I have array that element is hash a = [{:history_date=>15/07/10}, {:open_price=>7.90}] I want to
I have a data series of around 250 annual maximum rainfall measurements, maxima[,] and
I have array of class Person in ViewModel and I want to show their
I have array of words and I want to get a hash, where keys
I have a vector of temperatures and a cell array of Date/Time. I want
I have a set of measurements done regularly, but some are missing: measurement_date value
I have array A and Array B , I want to get as result

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.