LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting Data vs. Date

I am tracking my steps and distance per day using a pedometer.  To force myself to learn more about MathScript, I decided to monitor the results using MathScript.  In Excel, the charts allow using dates on the x-axis which is helpful for reviewing the data.  I can't seem to figure out how to do this in MathScript.  Here's a simple example for only two days of data:

time = [datenum('9-Apr-2007') datenum('10-Apr-2007')];
%time = ['9-Apr-2007' '10-Apr-2007' ];
steps = [2743 3000];
distance = [0.96 1.05];

figure(1);
plot(time, steps);
xlabel('Date');
ylabel('Steps');
title('Number of Steps vs. Date');

figure(2);
plot(time,distance);
xlabel('Date');
ylabel('Distance (miles)');
title('Distance vs. Date');

When I run this script I get the two plots and data with no errors.  The only problem is that date x-axis is in the datenum floating point format.  Is there any way to plot a date string?  Eventually I'll have a text file with the date in the first column and the # of steps and distance in the next two columns and read from this file.  First things first!

Also, in the next version of MathScript, can you please make the Esc key clear the current line in the Command Window?

Thanks

0 Kudos
Message 1 of 2
(6,625 Views)
Hello Derek,

That's great that you've picked a project to help learn MathScript.  Please feel free to report problems you're seeing or behavior you'd like to see.  Unfortunately, it is not possible in LabVIEW 8.2 MathScript to plot a date string.  However, we are considering adding support for both the date string and the ESC key behavior in a future release of LabVIEW.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 2 of 2
(6,612 Views)