From: Brian B on 22 Jul 2010 20:45 Hello, I'm trying to read a text file that has no column or row structure, here's a sample: [code] Configuration: # Surfaces = 6 # Strips = 160 # Vortices =1600 Sref = 11.511 Cref = 0.0000 Bref = 256211 Xref = 13.667 Yref = 0.0000 Zref = 0.0000 Standard axis orientation, X fwd, Z down Alpha = 0.00000 pb/2V = 0.00000 p'b/2V = 0.00000 Beta = 0.00000 qc/2V = 0.00000 Mach = 0.000 rb/2V = 0.00000 r'b/2V = 0.00000 CXtot = -0.22222 Cltot = 0.00000 Cl'tot = 0.11110 [/code] What I'd like to do is search for the equal signs in the text file and the use the string preceding the equal sign as the variable name and value succeeding the equal sign as the respective value for that variable. So far I've been playing around with functions: fileread, strfind(text,' = '), and textscan . If I stared at the help file long enough I'm sure I could find an inefficient way to capture the value after the equal sign, but I'm not sure how to assign it to its respective variable name. Thanks for your help! -Brian
|
Pages: 1 Prev: triscatteredinterp returning NaN at some points Next: plotting a line on a histogram |