Question

3. Write a MatLab program that reads in the set of values in the file Values.txt which is available from the d2l website. THow can I read a file and use the content to find the answer?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

clc
clear all
close all
m=0;
st=0;
A=load('Values.txt');
%A=randi(10,10,1);
for i=1:length(A)
m=m+A(i);
end
m=m/length(A);
for i=1:length(A)
st=st+(A(i)-m)^2;
end
st=sqrt(st/(length(A)-1));
disp('Mean is');
disp(m)
disp('Standard ddeviation is ');
disp(st);

MATLAB R2014a HOME EDITOR Find Files Compare ▼ Comment Print New Open Save Breakpoints Run Run and Advance Advance Run and In

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
How can I read a file and use the content to find the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • How can I read a file and use the content to find the answer?

    How can I read a file and use the content to find the answer? 3. Write a MatLab program that reads in the set of values in the file "Values.txt" which is available from the d2l website. The values are stored as ASCII text separated by carriage returns, so you can open the file and look at the valucs yourself by double clicking on the file name in MatLab's Current Directory window. Your program should next calculate and print out:...

  • How can I read a file and use the content to find the answer?

    How can I read a file and use the content to find the answer? 3. Write a MatLab program that reads in the set of values in the file "Values.txt" which is available from the d2l website. The values are stored as ASCII text separated by carriage returns, so you can open the file and look at the valucs yourself by double clicking on the file name in MatLab's Current Directory window. Your program should next calculate and print out:...

  • How can I read a file and use the content to find the answer?

    How can I read a file and use the content to find the answer? 3. Write a MatLab program that reads in the set of values in the file "Values.txt" which is available from the d2l website. The values are stored as ASCII text separated by carriage returns, so you can open the file and look at the valucs yourself by double clicking on the file name in MatLab's Current Directory window. Your program should next calculate and print out:...

  • Can someone tell me how to read a text file of an article into a number...

    Can someone tell me how to read a text file of an article into a number of words count? 3. Write a program that reads a text file and generate a histogram of the lengths of the words con- tained in the file. You should test your program using the file "marktwain.txt" available at the d2l website. You may use the MatLab functions isletter) or isspace) to test the characters in the array and size ) to determine the array...

  • Please read this comment: This is the only file given by my professor and so can...

    Please read this comment: This is the only file given by my professor and so can you please help me to write a python program. You can use any test file and post the output with the code. The output might be different then above but please help me to get started with the PYTHON code. Thank you in advance You are going to write a Python program that represents a command line version of a hexadecimal editor. This program...

  • Use C++ For this week’s lab you will write a program to read a data file...

    Use C++ For this week’s lab you will write a program to read a data file containing numerical values, one per line. The program should compute average of the numbers and also find the smallest and the largest value in the file. You may assume that the data file will have EXACTLY 100 integer values in it. Process all the values out of the data file. Show the average, smallest, largest, and the name of the data file in the...

  • Hi, I need to write a program for linux (putty) and please read carefully (I've asked...

    Hi, I need to write a program for linux (putty) and please read carefully (I've asked the same question 3 times because the experts who answered my questions wrote their own carmain1.cpp file. Please leave it where it is and only create car.cpp and car.h files.) Here's carmain1.cpp /* carmain1.cpp * Please don't rewrite this file * I will be using the exact * same file below when grading * */ #include <iostream> #include "car.h" using namespace std; int main()...

  • Write a Python program named aIP.py which will read data from a file named wireShark.txt and...

    Write a Python program named aIP.py which will read data from a file named wireShark.txt and extract all the pairs of source and destination ip addresses and output them in pairs to another file called IPAddresses.txt , one per line, listing source and destination. Example of output: Source                      Destination 192.168.1.180         239.255.255.250 Detailed Requirements: You will read from a file called wireShark.txt which, to avoid problems with finding paths, will be located in the same directory as your code You will...

  • Objective: Learn how to -- read string from a file -- write multiple files Problem: Modify...

    Objective: Learn how to -- read string from a file -- write multiple files Problem: Modify the Person class in Lab #4. It has four private data members firstNam (char[20]), day, month, year (all int); and two public member functions: setPerson(char *, int, int, int) and printInfo(). The function setPerson sets the first name and birthday in the order of day, month and year. The function printInfo prints first name and birthday. But it should print the date in the...

  • This is a java file and I am very confused on how to do this project!...

    This is a java file and I am very confused on how to do this project! please help!! Specifications Overview: You will write a program this week that is composed of three classes: the first class defines Ellipsoid objects, the second class defines EllipsoidList objects, and the third, Ellipsoid ListApp, reads in a file name entered by the user then reads the list name and Ellipsoid data from the file, creates Ellipsoid objects and stores them in an ArrayList of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT