Filter löschen
Filter löschen

Use a column from a text file to find value of a parameter in for loop

1 Ansicht (letzte 30 Tage)
sowmya
sowmya am 10 Mär. 2019
Beantwortet: darova am 10 Mär. 2019
I have a text file with 3 columns of numerical data. For every value of data in third column, I need to find the value of a paramete using for loop. How can i do this?

Antworten (1)

darova
darova am 10 Mär. 2019
fid = fopen('sowmya.txt');
A = fscanf(fid, '%g %g %g', [3 inf]);
fclose(fid);
A = A';
x = A(A:,3); % entire 3th column
for i = 1:lentgh(x)
x(i) = x(i) * rand;
end

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by