Clear Filters
Clear Filters

convert java code to matlab code

1 view (last 30 days)
nadia nadi
nadia nadi on 6 May 2022
Hello,
I need to convert this code to matlab. I have no idea about java. could anyone help me please.
public class NextFit extends Packing {
protected final boolean shouldDecrease = false;
public NextFit(double[] items) {
super(items);
}
@Override
protected void pack(double item) {
int binSize = this.bins.size();
boolean canFit = binSize > 0 && this.bins.get(binSize - 1).remainingCapacity >= item;
int binIndex = binSize - (canFit ? 1 : 0);
this.addItem(item, binIndex);
}
@Override
protected boolean shouldDecrease() {
return this.shouldDecrease;
}
}
Thanks

Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!