how to read each text file using stread command
Show older comments
hello dear
I want to read text file of ground motion displacemet data (44 files) but only show the last file GM44
clear all; close all; clc;
Sdir='C:\users\USER\Desktop\MCE'; %C:\users\USER\Desktop\MCE
Model='SMRF10';
Odir = strcat(Sdir,'\',Model,'\'); %C:\users\USER\Desktop\MCE\SMRF10
for X =[1:44]
if X<10
Tag_GM =strcat('GM0', int2str(X))
else
Tag_GM =strcat('GM', int2str(X))
end
fid=fopen(strcat(Odir,Tag_GM,'\',Model,'-',Tag_GM,'-StoryDispl.out'),'r'); %C:\users\USER\Desktop\MCE\SMRF10\PushOver_StoryDispl
StoryDisp=fscanf(fid,'%c',[12,inf]);
fclose(fid);
SDisp = strread(StoryDisp);
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!