Changing CData values for a surf plot.

36 visualizzazioni (ultimi 30 giorni)
Ali Shakeri
Ali Shakeri il 1 Nov 2020
Risposto: Divija Aleti il 5 Feb 2021
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 Commenti
Ali Shakeri
Ali Shakeri il 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

Accedi per commentare.

Risposte (1)

Divija Aleti
Divija Aleti il 5 Feb 2021

Categorie

Scopri di più su Data Distribution Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by