|
From: | Oliver Heimlich |
Subject: | Re: cell-array display in class |
Date: | Mon, 27 Apr 2015 06:05:34 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 |
On 26.04.2015 22:35, Colin Macdonald wrote:
Hi, I like how Octave displays cell arrays. Is it possible to enable the `[i,j] = ` display in my own class? If so, how? If not, I'll file a bug to improve on the status quo shown below. Example: good:>> C = {1 2; 3 4} C = { [1,1] = 1 [2,1] = 3 [1,2] = 2 [2,2] = 4 }Not so good:>> pkg load symbolic >> pkg load interval >> C(2,1) = sym('x') C = { [1,1] = 1 (sym) x [1,2] = 2 [2,2] = 4 } >> C(2,2) = infsup(0,5) C = { [1,1] = 1 (sym) x [1,2] = 2 [0, 5] }
Colin,I just debugged into the display method. If inputname(1) is an empty string, the method could use the variable “argn” to get the coordinates within the cell array and produce the desired output.
Oliver
[Prev in Thread] | Current Thread | [Next in Thread] |