Effacer les filtres
Effacer les filtres

To Extract data from the .csv or .xlsx file and out it ti the Matlab Base workspace for Simulink to access it and read data from it

3 vues (au cours des 30 derniers jours)
I have written code for extracting file from user and then read data from that file. I can extract file from this code but not able to read the data because it is showing error as (Undefined function or variable 'excelread_activex')
Code is given below for your reference:
handle = msgbox('Select Unladen Logged Data file');
pause(2);
if ishandle(handle)
delete(handle);
end
clear handle;
global pathname sim_time pathname_saved
if pathname~=0
[filename, pathname]= uigetfile({'*.csv'},'Load Data File',pathname);
if pathname==0;pathname=pathname_saved;end
if pathname~=0;pathname_saved=pathname;end
else
[filename, pathname]= uigetfile({'*.csv';'*.xlsx'},'Load Data File');pathname_saved=pathname;
end
if filename~=0
h_wait=waitbar(0,'Reading Logged Data........');
if filename~=0
ResultFile=[pathname filename]
raw = excelread_activex([pathname,'\',filename]);
waitbar(.5,h_wait);
  3 commentaires
Ankit
Ankit le 15 Jan 2020
Modifié(e) : Ankit le 15 Jan 2020
here you can find one similar solution to your problem:
You can also use "assignin" command to save the variables to workspace:
Ashwini  More
Ashwini More le 16 Jan 2020
Thank you for the solution!!
I only find the way to open the file with GUI. but I am not able to read data from it and further development is I want to remove specific rows from it. can you please suggest solution to it.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Workspace Variables and MAT-Files dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by