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
Keeping data imported from excel
4 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
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!
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!