how do I transfer .dat test file into matlab?
3 ビュー (過去 30 日間)
古いコメントを表示
I am trying to sample from a script written by someone in 2015. Everything else in my code should function correctly if I can get this file to be mined. I need to get it into [channels,data] in order for my code to function properly. Being from such an old version of matlab, I'm sure there's an different way to do this now. Any help would be greatly appreciated.
%Directory of test file
filename='Test_1';
filedir='C:\Users\admin\Documents\Testing\Test_1\';
%Calls sub function to mine data from .dat test file
[channels,data]=getfile(filedir,strcat(filename,'.csv'));
This is the error message that I get:
Undefined function 'getfile' for input arguments of type 'char'.
Error in OBS_ONE_Reduction (line 10)
[channels,data]=getfile(filedir,strcat(filename,'.csv'));
3 件のコメント
回答 (1 件)
Oguz Kaan Hancioglu
2023 年 2 月 15 日
I understand that getfile is a function that was already developed in your application in 2015. Now, Matlab has a getfile function and needs some hardware object as a first argument. Maybe changing "getfile" function name solves this problem.
4 件のコメント
dpb
2023 年 2 月 15 日
Easy enough to miss...but as a side note to TMW, that's a TERRIBLE function name to introduce into base or toolbox product -- that one's bound to clash with thousands of user-written functions of the same name (including the camelCase spelling).
Steven Lord
2023 年 2 月 15 日
There's no clash unless you try to call a user-defined getFile function with an rosdevice or ros2device object as input. The getFile method of rosdevice or ros2device objects is at level 7 of the function precedence order.
You could override that by writing a nested or local function named getFile (levels 3 or 4) or a private function by that name (level 6) and calling those with the ros*device object input. Or you call your getFile without specifying an object whose class has that method defined, that can call functions in the current folder or on the path (levels 10 or 11.)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!