Thanks, Ben. I didn't know the setappdata/getappdata pair, so I actually wrote one myself as a function, just adding my var to myhandles and attach to the figure handle. It worked fine for me so far :).
Ben, Thanks for the reply. I was trying to do this:
bp = uiextras.BoxPanel('Parent',hf,...
bp.Title = 'Original Title';
The objective is to be able to modify the title in a callback. I thought I could use the handle returned by findobj with tag string, but that handle seems not working. I think it due to the fact that the handle returned by findobj is the handle to the container of the composite GUI object, so it's not directly related to the title banner. Now I use guidata to save the actual handle of the boxpanel, then retrieve it inside the callback, and it works fine.
I don't know how difficult it is to modify the layout toolbox source code to make this happen, I will spend sometime look it up after finishing current task.
Thanks again for sharing a great GUI tool.
Thanks for this functions. It was very helpfull.
I would just remocomend the use of bsxfun instead of repmat, simpy because it's faster. The equivalent would be I believe:
[i, j] = find(bsxfun(@le, min(x1(1:end-1),x1(2:end)), max(x2(1:end-1),x2(2:end)).') & ...
bsxfun(@ge, max(x1(1:end-1),x1(2:end)), min(x2(1:end-1),x2(2:end)).') & ...
bsxfun(@le, min(y1(1:end-1),y1(2:end)), max(y2(1:end-1),y2(2:end)).') & ...
bsxfun(@ge, max(y1(1:end-1),y1(2:end)), min(y2(1:end-1),y2(2:end)).'));
Thanks again, Pedro
Ilya and Jan, because of floating point arithmetic, it's impossible to find intersections perfectly in all cases. Jan, your example has two curves that touch at a single point; some people might define this as an intersection. Your assertion that (0,0) isn't an intersection is debatable.
It also erroneously finds contact points (no real intersections).
Example: [x0, y0] = intersections([-1,0,-1], [-1,0,1], [1, 0, 1], [-1,0,1], 1);
returns point (0, 0) as intersection point although it isn't.