возможная ошибка патча matlab при доступе к XData, YData, ZData, CData - PullRequest
0 голосов
/ 30 мая 2019

Внезапно я не могу правильно получить доступ к данным внутри патчей. Это происходит на разных отдельных компьютерах с неизмененным кодом, который ранее не вызывал ошибок. Я не могу найти объяснение, я надеюсь, что кто-то даст мне ответ. Следующие инструкции больше не работают для меня:

Вариант 1)

% get the patches in axes object
vector_patches = findobj(ax, 'Type','patch');

% we get for example the first patch
h_patch = vector_patches(1)

% display the x-y-z coordinates in column-wise: sometimes appears no data, other times it recovers succesfully the x and y, but not z..
disp([h_patch.XData', h_patch.YData', h_patch.ZData']) 

Вариант 2)

% another way of accesing the data
vec_children = ax.Children; % get axes children

% we take the first object of vector. if it is patch...
if strcmp(get(vec_children(1),'Type','patch')),'patch')
    h_pat = vec_children(1);

    % then we extract in another way the data using get
    x_dat = get(h_pat,'XData');
    y_dat = get(h_pat,'YData');
    z_dat = get(h_pat,'ZData');

end %endif

% finally we try to display the results...
disp([x_dat', y_dat', z_dat'])

Это всегда работало для меня, но с сегодняшнего дня, с разными компьютерами, средами и версиями Matlab, оно работает больше :( Может кто-нибудь объяснить причину? Заранее спасибо

...