Fri 06 Apr 2012 11:23:13 PM UTC, comment #10:
I added a demo and pushed the changeset.
http://hg.savannah.gnu.org/hgweb/octave/rev/8150ccfffa22
|
Fri 06 Apr 2012 04:24:45 PM UTC, comment #9:
Thanks. I now have two examples where one works and the other fails. I'm attaching a patch that is based on your work so you should get the credit for it. Can you verify that it also works for you and commit it?
The examples I used were
(file #25602)
|
Fri 06 Apr 2012 04:06:48 PM UTC, comment #8:
Which example ?
The one below ?
This should just produce two points. Perhaps a better example is
|
Fri 06 Apr 2012 03:58:19 PM UTC, comment #7:
Okay. I gather now that the vectors are column vectors rather than row vectors. But according to comment #3, there was no problem when plot was used instead of line. However, I don't even get a line when I try the example
|
Fri 06 Apr 2012 03:37:40 PM UTC, comment #6:
Rik,
I tried the version below on both 3.4.0 and the default branch. Both gave me the same result.
The result is the same as
The reason you saw three points is because your version was equivalent to
|
Fri 06 Apr 2012 03:17:20 PM UTC, comment #5:
Ben, we've sort of ignored this bug report for a while.
I think something else may have crept into the code. Starting with a current tip and no patches applied if I try
I don't get two lines, just 3 points. This was supposed to work according to comment #3.
|
Tue 21 Feb 2012 12:42:30 AM UTC, comment #4:
I see. Well it still looks reasonable to use your approach but I would shift to using bsxfun rather than broadcasting. This will avoid having to set and restore the broadcasting warning state.
The following works:
The try/catch architecture is still needed.
|
Tue 21 Feb 2012 12:10:27 AM UTC, comment #3:
It is more than just comparing sizes. For compatibility the sizes (up to 2d) need a broadcast sort of functionality. In addition, the prop-name & prop-value pairs need to be supported.
Both the examples below work for Matlab. In Octave, both work if "line" is replaced by "plot".
|
Mon 20 Feb 2012 09:09:29 PM UTC, comment #2:
Ben,
If I understand your changeset you are just looking to see whether the number of elements for the X, Y, and Z arguments are the same. I think you can do this succinctly without broadcasting by using the isequal function which is equivalent to 'a == b == c == ...' and only returns true if everything is equal.
Looking at changeset-1.patch, I think the whole thing could be simplified to
|
Mon 02 Jan 2012 11:29:36 PM UTC, comment #1:
I'm not sure what the correct solution here is.
Recently Jordi added broadcasting to Octave. This feature is well suited toward plot functions.
Should each plot function handle the broadcasting independently, of should a single function be written for that purpose?
I've attaching two changesets. changeset-1.patch handles everything. The second version, changeset-2.patch, relies on a second function, broadcast(). I'm also attaching a prototype broadcast.m. However, I think it should be written in c++, so it isn't included as part of the changeset.
(file #24725, file #24726, file #24727)
|
Mon 02 Jan 2012 01:00:07 PM UTC, original submission:
The docs indicate that line(x,y,z,name,value) is valid syntax. Without "z" an error results.
In addition,
Both of these work in ML R2011b.
|