Challenge

Project 1 - Parsing NASA thermodynamic data

clear all
close all
clc


% Make directory
mkdir ' C: useradmindesktopNASA File parsing'
% Reading Data file NASA Thermodynamic
% Open a file & 'r' Open the file for reading
f1 = fopen('THERMO.dat','r');
gt = fgetl(f1);
% Obtaining Temperature by reading Header Information
global_temp = fgetl(f1);


% Spliting
t = strsplit(global_temp);
% converting strong cells to numbers using str2num

global_low_temp=str2num(t{2});
global_medium_temp=str2num(t{3});
global_high_temp=str2num(t{4});

% Temperature range & Gas Constant
% Temperature range assumed
Temp = linspace(global_low_temp,global_high_temp,1000);
% Universal Gas Constant J/(mol-K)

R = 8.314;
% Skipping three comment lines in the file


for i = 1:3
gt = fgetl(f1);
end


for i = 1:53


gt = fgetl(f1);
A = strsplit(gt, ' ');
species_sp = A({1});
line_1 = fgetl(f1);
a = strfind(line_1,'E');

% extracting higher & lower temperature coefficients
% % Extracting FIRST 7 Coefficients i.e. HIGH temperature coefficients

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.