Keeping data imported from excel

4 Ansichten (letzte 30 Tage)
Chris Jordan
Chris Jordan am 11 Mai 2015
Kommentiert: Thomas Koelen am 11 Mai 2015
I have managed to import data from excel but as soon as I try to do anything with those variables I have imported they disappear as if they were never imported. I have tried to save them and then use them but that doesn't work. I've tried to import the entire worksheet as one matrix and also each column as its own vector but nothing seems to work. I have also tried using the import wizard, the uiimport function and the xlsxread function and none seems to work. HELP!!! Here is the code I have written thus far: data=uiimport('Copy of Tensile_Data.xlsx'); clear,clc; time=data(:,1); extension=data(:,2); strain1=data(:,3); laod=data(:,4); tensile_stress=data(:,5); tensile_extension=data(:,6); tensile_strain=data(:,7); position=data(:,8); corrected_position=data(:,9);
  2 Kommentare
Chris Jordan
Chris Jordan am 11 Mai 2015
Never mind I managed to figure out what was wrong. All that fiddling and it turns out my clear,clc: was getting rid of my data because of where it was. X0
Thomas Koelen
Thomas Koelen am 11 Mai 2015
haha, happens to all of us :)

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Thomas Koelen
Thomas Koelen am 11 Mai 2015
This is how I load my excel sheets:
excelsheet = uigetfile('.xlsx','Select a file');
[num,txt,raw] = xlsread(excelsheet,'main');
I've never had any issues with "variables" disappearing!

Kategorien

Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by