Changing CData values for a surf plot.

45 vues (au cours des 30 derniers jours)
Ali Shakeri
Ali Shakeri le 1 Nov 2020
I want to symply change a surface plots Cdata with a callback.
cyl = surf(X_Length,Y_Circle,Z_Circle,'Cdata',map100);
Im trying thia cyl.Cdata = map200; but it wont work.
what can i do?
  4 commentaires
Ali Shakeri
Ali Shakeri le 1 Nov 2020
they are ofc
Ali Shakeri
Ali Shakeri le 1 Nov 2020
let me post the whole code :
map100 = getCylinderHeatMap(filename);
[X_Length,Y_Circle,Z_Circle,map100] = createSurfCylinderInitial(map100);
cyl = surf(X_Length,Y_Circle,Z_Circle,'Cdata',map100);
splitFileName = strsplit(string(T{1,1}),'.');
title(compose("3D Cylinder Heatmap Plot" + "\n" + "Time: " + splitFileName{1,1}));
zlabel("Z-Position");
ylabel("Y-Position");
xlabel("X-Length(Cm)");
set(gca,'Ydir','reverse')
colormap(myHeatMap);
colorbar;
shading interp
Maximum_Value = 450;
Minimum_Value = 50;
caxis([Minimum_Value Maximum_Value]);
callback
function []= sliderCallback(b,T,myHeatMap,cyl)
value = round(b.Value);
%Testing lines load your matrix%
filename = strcat('\Users\Ali\Desktop\Documents\DataVis\Projekt\data\day\', string(T{value,1}));
map100 = getCylinderHeatMap(filename);
splitFileName = strsplit(string(T{value,1}),'.');
map100 = createSurfCylinderMapOnly(map100);
cyl.Cdata = map100;
title(compose("3D Cylinder Heatmap Plot" + "\n" + "Time: " + splitFileName{1,1}));
zlabel("Z-Position");
ylabel("Y-Position");
xlabel("X-Length(Cm)");
set(gca,'Ydir','reverse');
colormap(myHeatMap);
colorbar;
shading interp
%
Maximum_Value = 450;
Minimum_Value = 50;
caxis([Minimum_Value Maximum_Value]);
end

Connectez-vous pour commenter.

Réponses (1)

Divija Aleti
Divija Aleti le 5 Fév 2021

Catégories

En savoir plus sur Data Distribution Plots dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by