Hi,
I have a list in my current Tcl file that I would like to use in my Matlab script for post-processing.
How can I get a hold of this list?
Thanks
Using Tcl lists outside of Opensees
Moderators: silvia, selimgunay, Moderators
-
- Posts: 71
- Joined: Fri Nov 06, 2009 6:40 am
- Location: Universidad del Norte, Colombia
Re: Using Tcl lists outside of Opensees
It is pretty simple...
In OpenSees:
set list {1 2 3 4 5}
set fid [open list.txt w]
puts $fid $list
close $fid
In MATLAB:
fid = fopen('list.txt', 'r');
list = fscanf(fid,'%f');
fclose(fid);
Regards.
In OpenSees:
set list {1 2 3 4 5}
set fid [open list.txt w]
puts $fid $list
close $fid
In MATLAB:
fid = fopen('list.txt', 'r');
list = fscanf(fid,'%f');
fclose(fid);
Regards.