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

请先登录,再进行评论。

采纳的回答

Sindar
Sindar 2020-5-7
Please don't post homework problems without showing your attempts and asking specific questions. I'm feeling generous, though, so:
  4 个评论
Sindar
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 CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by