Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
feather plot help please?

Subject: feather plot help please?

From: Bettaiyya

Date: 28 May, 2010 00:40:07

Message: 1 of 1

Hi all,
        Here is the code i wrote for feather plot with time series data (u and v) (wind data). When i get the graph after running this code the dates on the x axis is incorrect.

%% Get Data

[fn,pn] = uigetfile('*.data', 'Open the txt file to be read');




   set1 = find(date=='-',1,'first');
   set2 = find(date=='-',1,'last');
   day = str2double(date(1:set1-1));
   month = date(set1+1:set2-1);
   if(month == 'Jan')
       month = 1;
      if(month == 'Feb')
       month = 2;
      if(month == 'Mar')
       month = 3;
      if(month == 'Apr')
       month = 4;
      if(month == 'May')
       month = 5;
      if(month == 'Jun')
       month = 6;
      if(month == 'Jul')
       month = 7;
      if(month == 'Aug')
       month = 8;
      if(month == 'Sep')
       month = 9;
         if(month == 'Oct')
       month = 10;
         if(month == 'Nov')
       month = 11;
         if(month == 'Dec')
       month = 12;
   year = str2double(date(set2+1:set2+4));
   if(year < 100)
   time=sscanf(in1,'%*s %s',1);
   vector_time=[year month day hour minute second];
   field.value1(count)=sscanf(in1,'%*s %*s %f',1);
   field.value2(count)=sscanf(in1,'%*s %*s %*f %f',1);
   field.value3(count)=sscanf(in1,'%*s %*s %*f %*f %f',1);
   field.value4(count)=sscanf(in1,'%*s %*s %*f %*f %*f %f',1);
   field.value5(count)=sscanf(in1,'%*s %*s %*f %*f %*f %*f %f',1);

%% Feather plot

axis([min(field.time(:)) max(field.time(:)) -10 10]);
feather(field.value4(:), field.value5(:));

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us