I am trying to read this text file.
Stator M_19
Rotor M_19
Magnet n30h20
The text of interest is M_19 M_19 and n30h20. They are filenames of material files that will be read later.
Here is the Octave code that I tried.
clc; clear; close all;
% File path to the .csv file
filename = 'input_filenames.txt';
% Open the file
fid = fopen(filename);
% Read the first three rows of the file
formatSpec = '%s';
material_files = textscan(fid, formatSpec, 3, 2);
% Close the file
fclose(fid);
% Print the material filenames
disp(material_files);
Here is the error code I get.
error: textscan: 1 parameters given, but only 0 values error: called from test at line 11 column 16