Open a .txt file scripting

User: "HenLopes"
Altair Community Member
Updated by HenLopes

Hello,

 

I'm trying to open a .txt file in Compose but I get an error.

Error: invalid input in argument 1; type must be a string or a valid file stream in call to function textscan at line number 2

 

 

fid                         = fopen('nodes.txt');
track                       =textscan(fid, '%f %f %f %f %s %s');
fclose(fid);
track_node                  = track{:,1};
x_node_track                = track{:,2};
y_node_track                = track{:,3};
z_node_track                = track{:,4};

 

Do I need to import the txt file firstly ? If yes how can I do it?

How can I call a .txt file in Compose?

 

Thank you!

Find more posts tagged with