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 次查看(过去 30 天)
显示 更早的评论
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 个评论
Stephen23
2020-5-8
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)
采纳的回答
Sindar
2020-5-7
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 个评论
Sindar
2020-5-8
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)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!