How Display some of 2 dimension parameter?

可紊 提交于 2019-12-11 06:45:48

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!