How can I load data from Excel file to Matlab in script and use the data loaded to calculate?

1 次查看(过去 30 天)
Hi guys, I am a newbie in Matlab and I am using Matlab for my thesis. I have an excel file contain data and I want to load these data into Matlab and therefore I can write programme to calculate using these data in Matlab. How can I do that? Can you show me the full code because I am so new to this. Thank you very much!

回答(2 个)

David Hill
David Hill 2023-2-28
Use readmatrix or readtable. If you attach your spreadsheet we could help more.
  2 个评论
Newbie
Newbie 2023-2-28
My code
clc
syms t s Gs Gt Ks Es Et
E0 = [10490.3622];
v = 0.3;
Et = simplify(laplace(Et, t, s));
Ks = E0/(3*s*(1-2*v));
Gs = (9*Ks-Es)/(Es*Ks);
Gt = ilaplace(Gs,t);
writematrix([value_t(:),Gt(:)],'C:\Relaxation modulus\data.xlsx');

请先登录,再进行评论。


David Hill
David Hill 2023-2-28
MSU1=readmatrix('Relaxation data.xlsx','Range','A4:E82')%load the others following the same method
MSU1 = 79×5
1.0e+04 * 0 0 0 NaN 0 0.0000 0 0.0001 NaN NaN 0.0003 0.0000 0.0005 0.4870 0.1873 0.0005 0.0000 0.0008 0.8009 0.3080 0.0007 0.0000 0.0013 1.1517 0.4430 0.0009 0.0000 0.0016 0.6929 0.2665 0.0011 0.0000 0.0019 0.8668 0.3334 0.0013 0.0000 0.0023 1.0303 0.3963 0.0014 0.0000 0.0026 0.5757 0.2214 0.0016 0.0000 0.0029 0.8582 0.3301
  3 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Tables 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by