如何显示二维参数? [英] How Display some of 2 dimension parameter?
本文介绍了如何显示二维参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个参数t(i,j),并设置i,j/1 * 100/,我只想显示正t(I,j).
I have a parameter t(i,j) , and set i,j /1*100/ , I want to display only positive t(I,j) .
我的尝试
Display$(t(I,j)>0), t;
我也阅读了以下答案仅显示内容
当我写命令如abow answer时,出现错误
When I write my command like abow answer , I have error
" uncontrolled set entered as constant "
我应该写什么代码?
感谢&最好的
推荐答案
带有符号的Display语句将始终显示整个符号.您在另一篇文章中看到的$条件只能用于决定是否应完全显示或根本不显示它.您可以仅使用正值定义第二个参数,并显示如下:
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;
这篇关于如何显示二维参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文