# \#matlab

**URL:** https://discuss.ampl.com/tag/matlab/52.md

[Latest](https://discuss.ampl.com/latest.md) · [Categories](https://discuss.ampl.com/categories.md) · [Tags](https://discuss.ampl.com/tags.md)

---

## [Set 3-D matrix from matlab of size (MxNxP) that is effectively 2D (M=1, so it is 1xNxP)](https://discuss.ampl.com/t/set-3-d-matrix-from-matlab-of-size-mxnxp-that-is-effectively-2d-m-1-so-it-is-1xnxp/614)

<div class="topic-metadata">

**Author:** [@Sarah\_O](https://discuss.ampl.com/u/Sarah_O)\
**Replies:** 1\
**Last updated:** [July 19, 2023, 9:47am UTC](https://discuss.ampl.com/t/set-3-d-matrix-from-matlab-of-size-mxnxp-that-is-effectively-2d-m-1-so-it-is-1xnxp/614 "2023-07-19T09:47:12Z")

</div>

Hi, I am working on a model where I need to run multiple scenarios with data generated in Matlab to set a 3-D matrix, below is a snippet of my code U = 1:k; dfP = DataFrame(3, ‘U’, ‘AP’, ‘W’, ‘Pr’); dfP.setMatrix(Pr,…

---

## [Matlab does not recognize the (include) of AMPL codes](https://discuss.ampl.com/t/matlab-does-not-recognize-the-include-of-ampl-codes/623)

<div class="topic-metadata">

**Author:** [@Tania\_Castellanos](https://discuss.ampl.com/u/Tania_Castellanos)\
**Replies:** 3\
**Last updated:** [June 28, 2023, 6:57pm UTC](https://discuss.ampl.com/t/matlab-does-not-recognize-the-include-of-ampl-codes/623 "2023-06-28T18:57:05Z")

</div>

Hello, I am new in AMPL but, I am using the command read.ampl() from matlab, it works fine, in most cases. But when AMPL code calls using include codigo.mod, for example, Matlab will not recognize it and sends me an er…

---

## [Modify set from Matlab](https://discuss.ampl.com/t/modify-set-from-matlab/615)

<div class="topic-metadata">

**Author:** [@Sarah\_O](https://discuss.ampl.com/u/Sarah_O)\
**Replies:** 1\
**Last updated:** [June 21, 2023, 5:57pm UTC](https://discuss.ampl.com/t/modify-set-from-matlab/615 "2023-06-21T17:57:27Z")

</div>

I tried the following example from the Matlab AMPL API documentation website ampl.eval(‘set A;’); s = ampl.getSet(‘A’).get(); s.setValues({4.2, ‘4.2’, ‘a’, ‘b’}); s.asSet It gives the following error: No method ‘se…

---

## [Matlab presolve](https://discuss.ampl.com/t/matlab-presolve/600)

<div class="topic-metadata">

**Author:** [@Sarah\_O](https://discuss.ampl.com/u/Sarah_O)\
**Replies:** 2\
**Last updated:** [June 7, 2023, 2:42pm UTC](https://discuss.ampl.com/t/matlab-presolve/600 "2023-06-07T14:42:35Z")

</div>

Hi My question is a bit strange to ask here as it may suits Mathworks better, but I would love to hear from here. I have written an AMPL code that has more than 38000 constraints and after AMPL resolve it has around 70…

---

## [Set value of 3D parameter from MATLAB](https://discuss.ampl.com/t/set-value-of-3d-parameter-from-matlab/518)

<div class="topic-metadata">

**Author:** [@afsoon\_alidadi](https://discuss.ampl.com/u/afsoon_alidadi)\
**Replies:** 1\
**Last updated:** [April 26, 2023, 11:01pm UTC](https://discuss.ampl.com/t/set-value-of-3d-parameter-from-matlab/518 "2023-04-26T23:01:57Z")

</div>

Hello, I have a parameter as below; I want to set values from MATLAB array with dimensions H1(N\_u,NV\_T^2,N\_B}. AS I checked setValues function only supports 2D. Can you please let me know how I can set the values of the…
