[doc] adding inter and union for IntervalVector and IntervalMatrix, lessonB and C in Matlab#343
Conversation
|
|
||
| % Or using a fixpoint method: | ||
| function [x,y,m,a,d] = constraints(x,y,m,a,d,ctc_plus,ctc_polar,ctc_minus) | ||
| res_ctc_plus = ctc_plus.contract(py.codac4matlab.cart_prod(x(3), y(2), a)); % The result is a 3D IntervalVector |
There was a problem hiding this comment.
Simple curiosité : il est nécessaire de préciser "py.codac4matlab".cart_prod ?
There was a problem hiding this comment.
Oui, en matlab les fonctions ont un comportement qui fait qu'il faut visiblement préciser "py.codac4matlab." pour appeler les fonctions de codac.
C'est peut-être dû à une notion de "scope" de l'import
import py.codac4matlab.*
|
|
||
| while vol ~= prev_vol | ||
| prev_vol = vol; | ||
| [x,y,m,a,d] = constraints(x,y,m,a,d,ctc_plus,ctc_polar,ctc_minus); |
There was a problem hiding this comment.
"contract" au lieu de "constraints" (constraints = symbolique)
There was a problem hiding this comment.
Pour cette fonction j'ai repris le nom de la version python (constraints). J'ai changé le nom dans les deux fichiers.
| @@ -0,0 +1,26 @@ | |||
| classdef MyCtc < handle | |||
There was a problem hiding this comment.
Il n'y a pas d'héritage de Ctc_IntervalVector ?
There was a problem hiding this comment.
Matlab n'a pas l'air de vouloir créer un objet matlab à partir d'un objet python (Ctc_IntervalVector).
Un "patch" est d'ajouter un Ctc_IntervalVector dans les propriétés de la classe. Je l'avais fait mais je n'ai pas l'impression que ça soit utile ici donc je l'ai enlevé.
| // Example: | ||
| a = IntervalVector(2); // box for x | ||
| b = IntervalVector({{2,3},{5,6.2}}); // box for m | ||
| d = Interval(4.5,5); // interval for y |
Uh oh!
There was an error while loading. Please reload this page.