Droplet plotting on x-y plane
3 ビュー (過去 30 日間)
古いコメントを表示
Griffin Polglaze
2020 年 8 月 5 日
回答済み: Sudheer Bhimireddy
2020 年 8 月 5 日
The code below creates a movie which shows the growth of a droplet. This is done by reading a text file that contains 3 columns The first 2 columns are the droplet location i.e. x and y coordinates and the third columns in the droplet radius. In the current format I am able to plot the droplet but instead of increasing in its size, it travels up the 'r'. Is there anyway to allow the droplet to remain on the x,y plane but increase in size using the 'r' value?
clear
clc
close all
%% STEP ONE: LOAD DATA
a = '.txt';
%% STEP TWO: DRAW/RENDER SCENARIO
for i = 1:20
clf
str = int2str(i);
stp = strcat(str,a);
c = load(stp, 'w+');
s = size(c)
s1 = s(1,1)
s2 = s(1,2)
for ii = 1:s1
x(ii,1) = c(ii,1); % x-coordinate
y(ii,1) = c(ii,2); % y-coordinate
r(ii,1) = c(ii,3); % radius
end
plot3(x,y,r,'go')
title (['Droplet size at t = ',num2str(i),' seconds'])
drawnow
end
0 件のコメント
採用された回答
Sudheer Bhimireddy
2020 年 8 月 5 日
If you want to retain the droplet on xy plane, then use rectangle() at each circle center instead of plot3()
rectangle('Position',[x-r, y-r, 2*r, 2*r],'Curvature',[1,1]);
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!