Vehicle routing problem vrp

조회 수: 2 (최근 30일)
Astals
Astals 2020년 12월 17일
답변: SAI SRUJAN 2024년 7월 8일
Hello! I need help with coding, I need to implement a code that follows my maximum capacity from my demand.
A have five destinations ( 1,2,3,4,5) and the demand is( 5,6,7,8,9) my maximum capacity is 5. So I need it to print out the destinations after my maximum capacity

답변 (1개)

SAI SRUJAN
SAI SRUJAN 2024년 7월 8일
Hi Astals,
I understand that you have a list of destinations and corresponding demand values for each destination and want to filter and identify which destinations have demand exceeding a specified maximum capacity.
Please go through the following code sample to proceed further,
destinations = [1, 2, 3, 4, 5];
demand = [5, 6, 7, 8, 9];
max_capacity = 5;
% Filter destinations based on demand exceeding maximum capacity
filtered_destinations = destinations(demand > max_capacity);
% Display the filtered destinations
disp('Destinations with demand exceeding maximum capacity:')
disp(filtered_destinations)
I hope this helps!

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by