windows and mac differences in basic functionality readtable

2 ビュー (過去 30 日間)
Stephen Devlin
Stephen Devlin 2018 年 1 月 30 日
回答済み: Walter Roberson 2018 年 6 月 7 日
Hi,
I have a gui that runs perfectly fine on a Mac with 2017a, when I run it on win2017a (prior to compiling it) I get numerous errors. This one however I do not understand at all
Undefined operator '>' for input arguments of type 'cell'
I can trace it back to the line which reads in the data...
data=readtable(files(k).name,'FileType','text','Delimiter','tab','TreatAsEmpty',['UND. -60001','UND. -2011','UND. -62011']);
the Mac and Windows versions run this differently, the Mac honors the TreatAsEmpty, note on the Mac it requires double quotes (" ") around each argument to exclude as empty whereas the Windows version called that an error and wanted single quotes, it then does nothing with them. This leads to the array being a table in the Mac version of the GUI and a cell in the Windows version, I just can't see why some fundamental matlab basics would be so different between the versions?
Any ideas?
Best regards
Steve
close all
clear all
clc
AA=uigetdir('\\company.com\data\users\ProfileFolders\my.name\Desktop\');
A1=string(AA)
Folder_strings=char(strcat(A1,'/*.txt'))
Folder_used=dir(Folder_strings)
files=Folder_used
nFiles=numel(files)
nameHead=(files(1).name)
expressionA = 'P\H\d\d\d\_'
nameOfHead= regexp(nameHead,expressionA,'match')
nameOfHead=nameOfHead{:}
nameOfHead=(nameOfHead(1,1:5))
for k=1:nFiles
data=readtable(files(k).name,'FileType','text','Delimiter','tab','TreatAsEmpty',['UND. -60001','UND. -2011','UND. -62011']);
name3D=(files(k).name);
RN=name3D;
expression1 = 'M\d\R\d\_';
Z(k)= regexp(RN,expression1,'match');
%%Assign variables to data
vel_NS=data.Velocity_ms;%-NS.....Nozze Scan data
% vol_NS=data.Volume_pl;
% traj_NS=data.Trajectory_deg;
% noz_NS=data.ExpID;
vel_NS(vel_NS > 10)=NaN;%for awful data exceeding 10m/s this will remove them
end
  5 件のコメント
Walter Roberson
Walter Roberson 2018 年 2 月 2 日
Where you used "" as the delimiter, you used a facility available in R2017a and later; your other system must be running an earlier version.
Stephen Devlin
Stephen Devlin 2018 年 6 月 7 日
Hi Walter, if you want to move this to an answer field I will accept it, apologies for not getting back sooner.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2018 年 6 月 7 日
Where you used "" as the delimiter, you used a facility available in R2017a and later; your other system must be running an earlier version.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Identification についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by