Unable to open file 'Diabetes.csv'.
2 ビュー (過去 30 日間)
古いコメントを表示
I'm new to matlab I'm having trouble with this one. Where should I put my excel file so MATLAB can read it?
Code:
%Read data
clc
clear all
close all
data=readtable ('Diabetes.csv');
Error:
Error using readtable (line 143)
Unable to open file 'Diabetes.csv'.
1 件のコメント
Star Strider
2022 年 1 月 18 日
Be sure it’s on the MATLAB search path somewhere so that MATLAB can find it.
回答 (1 件)
Adam Danz
2022 年 1 月 18 日
編集済み: Adam Danz
2022 年 1 月 18 日
To add to @Star Strider's advice, you can put the file anywhere you want as long as it's folder is on the Matlab path. For example, if the file is in C:\Users\name\Documents\Matlab\data then add the path using
addpath('C:\Users\name\Documents\Matlab\data')
Now Matlab will be able to access the file.
Alternatively, you can specify the full path to the file so Matlab knows where it's at even if it's not on the Matlab path,
filepath = 'C:\Users\name\Documents\Matlab\data';
filename = 'Diabetes.csv';
data = readtable(fullfile(filepath, filename));
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!