Keeping data imported from excel

4 ビュー (過去 30 日間)
Chris Jordan
Chris Jordan 2015 年 5 月 11 日
コメント済み: Thomas Koelen 2015 年 5 月 11 日
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 件のコメント
Chris Jordan
Chris Jordan 2015 年 5 月 11 日
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 2015 年 5 月 11 日
haha, happens to all of us :)

サインインしてコメントする。

回答 (1 件)

Thomas Koelen
Thomas Koelen 2015 年 5 月 11 日
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!

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by