Asked by bharathi Dasari
on 16 Oct 2019 at 13:58

i had some spherical particles which will be moving with time i had the velocity data but to plot contour i need to assign to grid how to do this

Answer by darova
on 16 Oct 2019 at 18:55

Accepted Answer

Here is what i invented

clc,clear

A = readtable('ploc.txt');

A1 = A;

k = 1;

for i = 0:10

ii = (1:561) + 561*i;

A1(ii,:) = A(ii+k,:); % read only with numbers

k = k + 2;

end

A2 = table2array(A1); % convert table to array

A3 = zeros(length(A2),5);

for i = 1:length(A2)

A3(i,:) = str2num(A2{i}); % convert cell/str to number

end

cla

hold on

for i = 0:10

ii = (1:561) +i*561;

x = A3(ii,2);

y = A3(ii,3);

plot(x,y,'.r') % draw particles

pause(0.5)

end

hold off

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 6 Comments

## darova (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/485686-how-to-plot-individual-particle-velocites-in-a-closed-space#comment_756956

## bharathi Dasari (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/485686-how-to-plot-individual-particle-velocites-in-a-closed-space#comment_756968

## darova (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/485686-how-to-plot-individual-particle-velocites-in-a-closed-space#comment_756991

## bharathi Dasari (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/485686-how-to-plot-individual-particle-velocites-in-a-closed-space#comment_756999

## Sulaymon Eshkabilov (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/485686-how-to-plot-individual-particle-velocites-in-a-closed-space#comment_757003

## bharathi Dasari (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/485686-how-to-plot-individual-particle-velocites-in-a-closed-space#comment_757019

Sign in to comment.