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

조회 수: 3 (최근 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에서 Spreadsheets에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by