How do I used the program stickplot.m
Mostrar comentarios más antiguos
I have downloaded the stickplot.m program from WHOI.
The program 'feather plots' or 'stick plots' data with a scale (see attached 'stickplot.m' program). I have also attached the demo file ('stickdemo.m')
I do not know how to apply this program to my current data.
I have speed and direction and currents split into UV components (see attached 'stickplot data.csv' data set).
The code below is to read in the data.
All help would be greatly appreciated. Jenny
filename = 'D:\StickPlot data.csv';
delimiter = ';';
startRow = 10;
formatSpec = '%s%s%s%s%f%s%f%f%s%f%f%s%f%f%s%f%s%s%f%s%s%f%s%s%f%f%s%f%f%s%f%f%s%f%s%s%f%s%s%f%s%s%f%s%s%f%s%s%f%s%s%f%s%s%f%s%s%f%s%s%f%[^\n\r]';
% Open the text file.
fileID = fopen(filename,'r');
% Read columns of data according to format string.
textscan(fileID, '%[^\n\r]', startRow-1, 'ReturnOnError', false);
dataArray = textscan(fileID, formatSpec, 'Delimiter', delimiter, 'EmptyValue' ,NaN,'ReturnOnError', false);
% Close the text file.
fclose(fileID);
% Convert the contents of column with dates to serial date numbers using date format string (datenum).
dataArray{1} = datenum(dataArray{1}, 'mm/dd/yy HH:MM:SS');
% Allocate imported array to column variable names
Date5m = dataArray{:, 1};
Spd5m = dataArray{:, 7};
Dir5m = dataArray{:, 10};
vCurr5m = dataArray{:, 13};
uCurr5m = dataArray{:, 16};
% Clear temporary variables
clearvars filename delimiter startRow formatSpec fileID dataArray ans;
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Other Formats en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!