In: Electrical Engineering
I have an externa file lets call it "data" which is not written
in the MaTLab, I want to call it using a code so, I can read all
the data numbers from it and then plot it in a sine and cosine
waves in the graphical user interfernace (GUI)
I need it fast please
Thanks
There are several codes for importing data from different types of files
1. D = importdata(filename) %loads data into array D. genral files like image etc
2. Suppose you have file in exel format
D = xlsread(filename) % reads the first worksheet in the MS Excel spreadsheet workbook named filename and
%returns the numeric data in a matrix.
D = xlsread(filename,sheet) % reads the specified worksheet.
3. Data read from a text file
D = fscanf(fileID,formatSpec) % reads data from an open text file into column vector A and interprets values in
%the file according to the format specified by formatSpec.
OR
fileID = fopen('dtat.txt','w') ---------Example attached for first command----