Scroll through 1 dimension of plotted Array in one figure

조회 수: 3 (최근 30일)
Bernd  Ab
Bernd Ab 2017년 3월 24일
답변: Vladimir Golkov 2024년 6월 13일
Dear all i want to plot the Data in an array and overlay a vektor plot with quiver the Array for the main plot has the deimension 167x176x2000. Two additional Arrays of the same size contain the information for the quiver overlay. I do display the data as XY plots at a givven z value. Obviously i do not want to store 2000 Images. Instead i want a plot, were i can scroll through the 3d dimension of my Array either with the mouse wheel or up and down arrows. The values for the quiver need to be updated as well.
Here is my code wich currently only displays the last image.
quiver_factor=1000000000; %factor to increase the arrows on the quiver images WAS 100 BEFORE
colorscale=0.3; %max abs lateral force in nN. % 0.12 fo const Fz % ORIGINALLY 0.12
for k=1:size(Main_array,3)
clear imagex imagey
[X,Y]=meshgrid(1:size(2nd_array,1),1:size(2nd_array,2));
imagex(:,:)=2nd_array(:,:,k);
imagex=imagex'*quiver_factor;
imagey(:,:)=3nd_array(:,:,k);
imagey=imagey'*quiver_factor;
image_F=Main_array(:,:,k)';
contourf(X,Y,image_F, 512, 'LineColor', 'none');
colormap(hsv(1024));
hold on
quiver(X,Y,imagex,imagey);
hold off
end
I found the follwing link, but could make the solution work with my code:
Thanks n advance!

답변 (1개)

Vladimir Golkov
Vladimir Golkov 2024년 6월 13일

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by