Unable to open file 'Diabetes.csv'.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Star Strider
el 18 de En. de 2022
Be sure it’s on the MATLAB search path somewhere so that MATLAB can find it.
Respuestas (1)
Adam Danz
el 18 de En. de 2022
Editada: Adam Danz
el 18 de En. de 2022
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 comentarios
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!