content of text file exploring, how?

1 vue (au cours des 30 derniers jours)
Nate
Nate le 15 Juil 2022
Commenté : KSSV le 15 Juil 2022
FileName='Q4.txt';
fileID=fopen(FileName);
CellOutput=[]
Delimiter=','
while feof(fileID)~=1;
a=fgetl(fileID);
a=strsplit(a,Delimiter);
for count=1:1:length(a);
Temp=str2num(a{count});
if ~isempty(Temp);
a{count}=Temp;
end
end
CellOutput=[CellOutput;a]
end
fclose(fileID);
TextOrNum=[]; %This line can be deleted after you are done coding this function.
%%Start your code for this function after this line:
TextToCheck = importdata('Q4.txt')
Numeric= TextToCheck.data
TextToCheck.textdata(2:end,3:end)=num2cell(Numeric)
TextOrNum= TextToCheck.textdata
for i= 1:length(TextOrNum)-1
Fmax{i}=max(Numeric(i,:))
end
Material= TextOrNum(2:end,2)
MaterialxFmax=[Material,Fmax']
SaF=[]
for j=1:length(Properties)
same=ismember(MaterialxFmax(:,1),Properties(j,1));
if same==1;
SaF=(MaterialxFmax(j,2)/Properties(j,2))
end
end
why is this code not running?
  3 commentaires
Chunru
Chunru le 15 Juil 2022
Attach your data.
KSSV
KSSV le 15 Juil 2022
It may not be running becuase, the text file is not in the prest working directory. Check the value of fileID.
If not, is it throwing any error? You have to specify the error.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by