Thursday, July 06, 2006

MATLAB 5.3: Data Files

This homework will ask a user to enter 10 lottery numbers in two panels and then display those numbers in a table also a MS-WORD file will be brought in and display along with all variables used. The first will be saved as an ASCII/.dat file.


%saving and loading files by Your Name Here


clc
lotto1=input('Enter 5 numbers for the first lottery ticket panel');
lotto2=input('Enter 5 different numbers for the second lottery ticket panel');
disp('pick 1 pick 2')
table=[lotto1',lotto2'];
disp(table)
save yournamehere51.dat table /ascii
load YNHword.txt
disp('This is a MS Word file created earlier.')
disp(YNHword)
who
clear

Enter 5 numbers for the first lottery ticket panel[1,2,3,4,5]
Enter 5 different numbers for the second lottery ticket panel[6,7,8,9,99]
pick 1 pick 2
1 6
2 7
3 8
4 9
5 99

This is a MS Word file created earlier.
4 6 7
12 23 76


Your variables are:

YNHword lotto1 lotto2 table

No comments: