问题
I have a parameter t(i,j) , and set i,j /1*100/ , I want to display only positive t(I,j) .
My try
Display$(t(I,j)>0), t;
I read following answer too Display only something
When I write my command like abow answer , I have error
" uncontrolled set entered as constant "
What code should I write?
Thanks & Best
回答1:
The Display statement with with a symbol will always show the whole symbol. The $ condition you saw in the other post, can only be used to decide, if it should be displayed completely or not at all. You could define a second parameter with just the positive values and display it like this:
Set i /1*100/,
j /1*100/;
Parameter t(i,j);
t(i,j) = uniformInt(-50,50);
Parameter tPos(i,j);
tPos(i,j)$(t(i,j)>0) = t(i,j);
Display tPos;
来源:https://stackoverflow.com/questions/52164228/how-display-some-of-2-dimension-parameter