简体   繁体   中英

2D Vector Plot MatLab With Wind Data (data is in structs)

I'm currently aiming to make a 2D vector plot of U and V directional wind. I have currently have a <1x2 struct> that has everything bundled into it. Within that <1x2 struct> are two <1x1 struct>s which pertain to U and V direction wind.

Within those <1x1 struct>s I have a field entitled "fltarray" which is a <262792x1 double> and that holds the velocity magnitude of the wind vector. In addition to that there is a field "bds" which contains a <1x1 struct> which holds a field "bindata" that has the value of a <262793x1 uint8> which I believe is the angle direction of the wind magnitude.

This setup is duplicated for the V-vector component (commonly called "i" component) of the wind vector.

Ideally I'm aiming to pair the directions of the magnitudes with the direction and then plot the UV resultant vectors that result from the pairing.

I've tried to upload pictures, but apparently my reputation is not high enough >_<

Those pictures can be found: http://www.flickr.com/photos/bsarg-bassplayer/ at the front of that photo stream. Thank you for any and all help relating to this!

Once u have a 2 vectors U = x_component (size = n * 1) where n is the time vector & V = y_component (size = n * 1) and t then its simple

f = figure(1);
axes

mags = sqrt(U.^2+V.^2);

max_mag = max(mags);

q = quiver(0,0,U(1),V(1))

set(gca,'xlim',[-1*max_mag-1 max_mag+1],'ylim',[-1*max_mag-1 max_mag+1])

hold all

for aa = 2:n
    set(q,'UData',U(aa),'VData',V(aa));
    pause
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM