且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MATLAB 4D(3D +彩色)剧情动画

更新时间:2023-01-26 13:36:23

创建2D或3D矩阵来定义你的颜色:如果你使用的颜色索引到的颜色映射,或者3D,如果你想给RGB值的2D

Create a 2D or 3D matrix to define your colors: 2D if you use colors indexed into the colormap, or 3D if you want to give RGB values.

X=1:30;Y=randperm(30);Z=ones(size(X));
voltage_matrix = ...; %# 30 by 133 
cdata = voltage_matrix;
handle = scatter3(X,Y,Z);

colormap('jet')
set(gca,'clim',[min(voltage_matrix) max(voltage_matrix)])

for t=1:size(cdata,2) %# 1 to 133
    set(handle, 'cdata', cdata(:,t));
    pause(.1)
end

编辑:注意颜色表和斧头CLIM属性。

note the colormap and axes 'clim' property.