1. For x from 1 to 100, calculate y. Use fopen and fprintf to write x and y data into a file named “my_data.txt”. Then use fopen and fscanf to read the data. Show the data in two columns. Function to be used: y = e^(0.02x)
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Feel_The_Beard
il 7 Mag 2020
Commentato: Feel_The_Beard
il 8 Mag 2020
1. For x from 1 to 100, calculate y. Use fopen and fprintf to write x and y data into a file named “my_data.txt”. Then use fopen and fscanf to read the data. Show the data in two columns. Function to be used: y = e^(0.02x)
6 Commenti
Stephen23
il 8 Mag 2020
Original question by Gerardo De Jesus Salazar retrieved from Google Cache:
1. For x from 1 to 100, calculate y. Use fopen and fprintf to write x and y data into a file named “my_data.txt”. Then use fopen and fscanf to read the data. Show the data in two columns.
- For x from 1 to 100, calculate y. Use fopen and fprintf to write x and y data into a file named “my_data.txt”. Then use fopen and fscanf to read the data. Show the data in two columns. Function to be used: y = e^(0.02x)
Risposta accettata
Sindar
il 7 Mag 2020
Please don't post homework problems without showing your attempts and asking specific questions. I'm feeling generous, though, so:
- Learn the basics of MATLAB: https://www.mathworks.com/learn/tutorials/matlab-onramp.html
- Documentation for fopen, fprintf, fscanf
4 Commenti
Sindar
il 8 Mag 2020
Terminology: that's a Code Analyzer message, not an error. These may help you improve your code, but they don't need to be resolved (and in some cases are just useless). See here for a guide: https://www.mathworks.com/help/matlab/matlab_prog/preallocating-arrays.html. You've got basically the example.
Note for questions: most of us don't like looking at attachments. If you've got code to share, put it in a code block (Alt-Enter)
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!