Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Application: Logistics Problem | Learning Through Applications
Matlab Basics
course content

Conteúdo do Curso

Matlab Basics

Matlab Basics

1. Basic Syntax and Coding with a Text Editor
2. Coding Foundations
3. Learning Through Applications
4. Visualizations
5. Recursion and Matrix Multiplication

book
Application: Logistics Problem

Continuing what you learned from the last chapter, here you'll learn how to help a distributor that's trying to optimize how they combine their products into shipments. You'll put everything you've learned into action, and pick up a bunch of new details along the way.

Task

  1. Understand the Goals
    Analyze the program's objectives and refer to the video for guidance and inspiration;

  2. Locate the Excel File
    Identify the file containing data about bins and industry grades for palettes;

  3. Import the Data
    Use a library like Pandas to load the Excel file, extracting data on bins and industry grading standards;

  4. Generate Bin Combinations
    Create all possible combinations of bins for grouping them into palettes, as demonstrated in the last chapter;

  5. Evaluate Each Combination
    For every possible bin combination:

    • Analyze Each Palette: compute average properties (e.g., tensile strength and percent defects) for the bins in each palette;
    • Grade and Price Palettes: assign grades and calculate prices based on the averages and industry standards from the Excel file;
    • Compare Sales Prices: track the best combination by comparing the total sales price of the current combination with previous results;
  6. Identify the Best Combination
    Once the optimal combination is determined, extract the corresponding bin tags using row indices;

  7. Export Results
    Save the final results, including the best combination and associated details, back to an Excel file;

  8. Quality Control

    • Cross-check the program's output with the results shown in the video, ensuring the optimal price matches;
    • Validate palette properties against industry standards using spreadsheet calculations;
  9. Iterate and Refine

    • Design your program with a modular approach for better organization;
    • Adjust and test your implementation iteratively to ensure accuracy and reliability.
  1. Data Importing

    • Bin Properties: import as a matrix containing properties such as weight, tensile strength, and percent defects;
    • Bin Tags: import as a separate matrix;
    • Industry Grade Standards: import as a matrix containing minimal tensile strength, maximum percent defects, and price per palette of 3 bins (7500 lbs);
    • Industry Grade Names: Import as a cell array;
  2. Generate Combinations

    • Instead of using Generate_Combinations_MMS_M from chapter 3, use the perms function to generate permutations directly;
  3. Identifying Bin Tags

    • Bin tags are recorded as indices that indicate the row positions in the original data. Convert these indices into bin tags using the row indices from the bin tags matrix;
    • Ensure that the row indices are correctly matched between the bin tags and the original data;
  4. Handling Dimensions and Indices

    • 2D Matrices: these are used for importing and exporting data to and from Excel. Make sure to reference the correct rows and columns;
    • 3D Matrices: the palette_permutations matrix contains all possible bin combinations folded into a 3D matrix;
      • Each row represents a specific combination of bins into palettes;
      • Each column represents the index of a specific bin;
      • The third dimension (1, 2, 3) corresponds to different palettes;
  5. Divide and Conquer Approach

    • Limit the for loop to a single iteration (e.g., for 1:1) to finish the rest of the program and output initial results;
    • Focus on getting the program to output bin tags, palette grades, and the optimal price to Excel one at a time. You can comment out parts of the code to focus on specific aspects;
  6. Verification

    • Manually verify the average properties of each palette to ensure they are correctly calculated and graded, as well as the total price of the palette combination;
    • If issues arise, use these verifications to diagnose problems within the for loop;
  7. Test Specific Permutations

    • If results are correct for one permutation but an optimal combination isn't found, limit the for loop to test a specific permutation, such as for 32280:32280 or for 16640:16640. This allows you to check performance on drastically different combinations;
  8. Troubleshooting

    • If the issue persists after verifying different permutations, there may be a problem with the logic that selects the best permutation from the evaluated iterations. Check the video to compare your results and ensure accuracy.

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 4
We're sorry to hear that something went wrong. What happened?
some-alt