Question

MATLAB 2017b i know i didnt post the data file "exam_data.txt" hypothtically how would i do...

MATLAB 2017b

i know i didnt post the data file "exam_data.txt" hypothtically how would i do this problem with access to the file

Download the file “exam_data.txt” from Black Board (or your email) to your directory.

Read the file into 13 by 7 array

Find the largest and smallest number in the array

Write these two results into a file and name the file:

lastname_firstname_exam2_problem1_output_file.txt

Make sure that your problem checks the reading and writing operations.

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

Code: -

fileID = fopen('exam_data.txt','r'); % open file in read mode
formatSpec = '%f'; % format of the data to read
sizeA = [13 7]; % shape of output array
A = fscanf(fileID,formatSpec,sizeA); %Read the file data, filling output array, A, in column order
fclose(fileID);
max_value = max(max(A));
min_value = min(min(A));
kk=[max_value min_value];
file_name ="lastname_firstname_exam2_problem1_output_file.txt";
fileID1 = fopen(file_name,'w'); % open file in write mode
fprintf(fileID1,'%f %f',kk); % write variable in file
fclose(fileID1);

Output:-

I can not show output because you have not post the exam_data.txt

Add a comment
Know the answer?
Add Answer to:
MATLAB 2017b i know i didnt post the data file "exam_data.txt" hypothtically how would i do...
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
  • I know there is a similar problem answered but it didnt quite work for me. Can...

    I know there is a similar problem answered but it didnt quite work for me. Can i have in in windows form please. i really dont understand this one Sales analysis Modify the application that you created in programming exercise 1 so it also displays the following: Average values in the array Largest Value in the array Smallest Value in the array

  • How do I correct this error in my code? When it got to the file type...

    How do I correct this error in my code? When it got to the file type I can only go "null" from a certain point and I'm wondering how to correct this error. Also can I get a word document on this coding strategy for this problem? How much of this am I doing correctly? The original problem description: Create a program that provides a listing of all the files in a directory. The program should be a Java application...

  • 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:...

  • 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:...

  • There is a file called mat2.txt in our files area under the Assignments folder. Download it...

    There is a file called mat2.txt in our files area under the Assignments folder. Download it and save it in the same folder where this Matlab file (HW08_02.m) is saved. It may be worth opening that text file to see how it is set out. Note well, however, that the file might have a different number of lines and different number of numbers on each line. Write a Matlab program that does the following: Prompt the user for an input...

  • Need this in C The starter code is long, if you know how to do it...

    Need this in C The starter code is long, if you know how to do it in other way please do. Do the best you can please. Here's the starter code: // ----------------------------------------------------------------------- // monsterdb.c // ----------------------------------------------------------------------- #include #include #include // ----------------------------------------------------------------------- // Some defines #define NAME_MAX 64 #define BUFFER_MAX 256 // ----------------------------------------------------------------------- // Structs typedef struct { char name[NAME_MAX]; int hp; int attackPower; int armor; } Character; typedef struct { int size; Character *list; } CharacterContainer; // ----------------------------------------------------------------------- //...

  • This is a c# assignment Please do not post just the code, I don't even know...

    This is a c# assignment Please do not post just the code, I don't even know how to start the project. Please explain step by step how I could complete this assignment. Thank you for your time! Create a database that stores baseball player information. You will have the following columns. You will need to have the ability to add rows and display the records. You may use LINQ or Given example using an access accdb file... Name string Batting...

  • problem2, the file "Test_Data.xlsx" contains in cylinder pressure data from a firing engine. the data is...

    problem2, the file "Test_Data.xlsx" contains in cylinder pressure data from a firing engine. the data is resolved in crank angle degree and is taken every 1/2 degree. O tittps/ualearn blackboard.com/bbcswebdav/pid plot a new function on the same graph overwriting the orizinal function 1 of11ρ Functions to choose from: y A sin(Bx C)+ D y A sin2(Bx+ C) + D y A In(Bx + C)D y A exp(Bx + C)+ D ž. The file "Test Data.xlsx" contains in-cylinder pressure data from...

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