How to read first set of data from the file given and assign those values according to the columns to the variable GradVec?
1 次查看(过去 30 天)
显示 更早的评论
I have attached here a value.text file. I want to read the first set of the file and assign those values to GradVec such that the rows of the values from text file and rows of the GradVec are the same and then I want it to read the second set from the value.text file and assign to GradVev. This should happen in a loop.
GradVec= [0 0 0] .... These are initial values
Kindly please help me.
Thank you
2 个评论
Mathieu NOE
2023-5-17
hello
do I understand correctly that you want to read the txt file line by line and append the result to the previous GradVec 3x 1 vector ?
why not then reading the entire file directly , for instance with readmatrix ?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!