Question

In: Electrical Engineering

I have an externa file lets call it "data" which is not written in the MaTLab,...

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

Solutions

Expert Solution

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----


Related Solutions

I'm new in MATLAB and I have to write a code in MATLAB which converts a...
I'm new in MATLAB and I have to write a code in MATLAB which converts a number from one base to another without using base2base, etc
Using C programming I have a file that contains earthquake data that I will copy and...
Using C programming I have a file that contains earthquake data that I will copy and paste below. I want to use either bubble or insertion sort to sort the file by latitude in ascending order, then create a new file containing the sorted data. example file to sort: time,latitude,longitude,depth,mag,magType,nst,gap,dmin,rms,net 2020-10-17T17:22:03.840Z,32.877,-116.2991667,0.31,1.16,ml,21,119,0.07747,0.26,ci 2020-10-17T17:17:29.980Z,34.1611667,-116.452,2.75,0.87,ml,17,66,0.05224,0.22,ci 2020-10-17T17:03:54.460Z,33.5396667,-116.4613333,8.66,0.63,ml,18,126,0.06084,0.16,ci 2020-10-17T16:55:01.080Z,63.254,-151.5232,8,1.4,ml,,,,0.9,ak
When using the import wizard in MATLAB to import data fro, a .csv file the data...
When using the import wizard in MATLAB to import data fro, a .csv file the data appears in MATLAB in the following format "35:53.2" how do I convert this into more usable matlab values? I think that the duration function was used to generate the time format. The code will need to be written in MATLAB software I will leave feedback if you are able to provide a correct response. Thank you
So I have written a code for it but i just have a problem with the...
So I have written a code for it but i just have a problem with the output. For the month with the highest temperature and lowest temperature, my code starts at 0 instead of 1. For example if I input that month 1 had a high of 20 and low of -10, and every other month had much warmer weather than that, it should say "The month with the lowest temperature is 1" but instead it says "The month with...
Lets say for a sample of data the correlation coefficient is zero. I know this means...
Lets say for a sample of data the correlation coefficient is zero. I know this means there is no linear relationship, and if you tried to fit the data by a least-squares then the slope would also be zero. But if you did this analysis, could you get a nonzero y-intercept? I think you could, but curious to see what other people think.
hey I have this program written in c++ and I have a problem with if statement...
hey I have this program written in c++ and I have a problem with if statement {} brackets and I was wondering if someone can fix it. //Name: Group1_QueueImplementation.cpp //made by ibrahem alrefai //programming project one part 4 //group members: Mohammad Bayat, Seungmin Baek,Ibrahem Alrefai #include <iostream> #include<stdlib.h> using namespace std; struct node { string data; struct node* next; }; struct node* front = NULL; struct node* rear = NULL; struct node* temp; void Insert() {     string val;    ...
So, I have this Matlab program that I have made for a lab, and despite having...
So, I have this Matlab program that I have made for a lab, and despite having different frequencies, when I go to plot them, the graphs look exactly the same. Can someone tell me why that is? I also need to know how to determine the digital frequencies(rad/sec) and how many samples per period of both of the waves? Thank you Code: N = 100; % Total number of time domain samples in simulation. A1 = 1; % Amplitude of...
C++ 1. Modify this program to open the file "Customers.dat" so that all data is written...
C++ 1. Modify this program to open the file "Customers.dat" so that all data is written to the end of the file AND to allow the file to be read. 2. Create a method called "getLargestCustomerNumber" and call it after the "Customers.dat" file has been opened. Read all the existing customerNumbers and determine the largest customerNumber - do not assume the last record in the file is the largest number. Use this number as the base when adding new customer...
Lets say I owned a business worth $100 million dollars and I have 25% stake in...
Lets say I owned a business worth $100 million dollars and I have 25% stake in the company. Lets say 100% of the what I own in the company will be taxable and I am married and it will be filed jointly. Company's net income is $17.5 million. If I was selling the company how much estate tax attributable would I be facing filing jointly?
Lets say I owned a business worth $100 million dollars and I have 25% stake in...
Lets say I owned a business worth $100 million dollars and I have 25% stake in the company. Lets say 100% of the what I own in the company will be taxable and I am married and it will be filed jointly. Company's net income is $17.5 million. What would be the estate tax attributable, 100% interest will be taxable and filling jointly? Also can you please mention some tax laws that would be beneficial in this situation?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT