Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| post:coarsegraintrackdata.m [2022/07/18 23:03] – created pseudomoaner | post:coarsegraintrackdata.m [2022/07/18 23:33] (current) – pseudomoaner | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| **Author:** Oliver J. Meacock | **Author:** Oliver J. Meacock | ||
| - | <code matlab | + | <code matlab |
| - | function [fieldFlow, | + | function [fieldFlow, |
| %COARSEGRAINTRACKDATA converts track data into continuum flowfield data by | %COARSEGRAINTRACKDATA converts track data into continuum flowfield data by | ||
| %binning up cells and averaging their instantaneous velocities in each bin. | %binning up cells and averaging their instantaneous velocities in each bin. | ||
| % | % | ||
| % | % | ||
| - | % | + | % |
| + | % | ||
| % | % | ||
| % | % | ||
| Line 24: | Line 25: | ||
| %Bin data from the PTV approach into boxes equivalent to the PIV grid | %Bin data from the PTV approach into boxes equivalent to the PIV grid | ||
| - | xEdges = linspace(0,fieldSettings.fieldWidth, | + | xEdges = linspace(0,trackSettings.maxX, |
| - | yEdges = linspace(0,fieldSettings.fieldHeight, | + | yEdges = linspace(0,trackSettings.maxY, |
| - | flowBins = cell(noBinsX, | + | flowBins = cell(noBinsX, |
| - | oriBins = cell(noBinsX, | + | oriBins = cell(noBinsX, |
| %Collate data from all tracks into bin structure | %Collate data from all tracks into bin structure | ||
| Line 49: | Line 50: | ||
| end | end | ||
| - | fieldFlow = zeros(noBinsX, | + | fieldFlow = zeros(noBinsX, |
| - | fieldPhi = zeros(noBinsX, | + | fieldPhi = zeros(noBinsX, |
| for i = 1:noBinsX | for i = 1:noBinsX | ||
| for j = 1:noBinsY | for j = 1:noBinsY | ||
| Line 61: | Line 62: | ||
| end | end | ||
| </ | </ | ||
| + | |||
| + | **Example usage** | ||
| + | <code matlab> | ||
| + | %Apply coarsegraining procedure to some input monolayer data | ||
| + | [fieldFlow, | ||
| + | |||
| + | %Visualise results for 100th timepoint using quiver and image representations of flow and orientation data respectively | ||
| + | subplot(1, | ||
| + | quiver(fieldFlow(:,:, | ||
| + | axis equal | ||
| + | |||
| + | subplot(1, | ||
| + | imagesc(fieldPhi(:,:, | ||
| + | axis equal | ||
| + | colormap(' | ||
| + | </ | ||
| + | |||
| + | **Example output** | ||
| + | {{ : | ||