How to read first set of data from the file given and assign those values according to the columns to the variable GradVec?

1 visualizzazione (ultimi 30 giorni)
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 Commenti
Mathieu NOE
Mathieu NOE il 17 Mag 2023
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 ?
Adeline War
Adeline War il 17 Mag 2023
Modificato: Adeline War il 17 Mag 2023
@Mathieu NOE I want to read one line and then add those values to the given variable GradVec = [0 0 0] such that 0 are replaced by new values. After that using those values I would have to do some finite element analysis and then again i need the next set and this has to happen in a loop.
Could you help me?

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by