hist within a parfor creates transparency violation error?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Cheng Jia
am 1 Mär. 2018
Bearbeitet: Edric Ellis
am 2 Mär. 2018
This code creates a transparency violation error. Is this by design??
s = cell(2,1);
s{1} = randn(100);
s{2} = randn(100);
parfor i=1:2
figure(i);
y = s{i};
hist(y);
end
0 Kommentare
Akzeptierte Antwort
Edric Ellis
am 2 Mär. 2018
Bearbeitet: Edric Ellis
am 2 Mär. 2018
hist internally uses inputname to support additional functionality in the resulting plot. Unfortunately, using inputname in a function called from parfor results in the transparency violation error you're seeing. You can work around this by ensuring that the input to hist doesn't have a name (i.e. it's a temporary):
parfor i=1:2
figure(i);
y = s{i};
hist(1 .* y);
% hist(s{i}) also works
end
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!