how to do the following logic in matlab from excel?
조회 수: 1 (최근 30일)
이전 댓글 표시
Vishnuvardhan Naidu Tanga
2021년 10월 28일
댓글: Vishnuvardhan Naidu Tanga
2021년 10월 28일
Hello all,
I am new to matlab. I am trying to perform a logic in matlab. The log is available in excel wich is as follows.
2pirdr = 2*H$2*0.5*(A2+A3)*(A2-A3)*0.000001*0.5*(B2+B3) and vflow = =D3+C2 for negative coloumn1 and
2pirdr = =2*H$2*0.5*(A60+A59)*(A60-A59)*0.000001*0.5*(B59+B60) and vflow = =D59+C60 for positive coloumn1
Can someone please help me with this. Thanks in advance.
댓글 수: 0
채택된 답변
LeoAiE
2021년 10월 28일
편집: LeoAiE
2021년 10월 28일
Hi,
First step is to Clean your data and name your columns something won’t confuse MATALB something like Radius, Velocity, 2pirdr and Vflow. Next get rid of the Pi value. MATLAB already have pi just type pi. then import your file in MATALB
Data = readtable ('Abb73at100.xlsx');
Now, use indexing to replace your A3, A2, B2 etc. Cell numbers in excel minus one
2pirdr = 2*pi*0.5*(Data.Radius(1)+ Data.Radius(2))*(Data.Radius(1)- Data.Radius(2))*0.000001*0.5*(Data.Velocity(1)+Data.Velocity(2));
vflow = =Data.Vflow(2)+ Data.2pirdr(1);
% now you should consider changing the variables names instead of
% overwriting them like
2pirdr_2 = 2*pi*0.5*(Data.Radius(59)+Data.Radius(58))*(Data.Radius(59)-Data.Radius(58))*0.000001*0.5*(Data.Velocity(58)+Data.Velocity(59));
vflow_2 = Data.Vflow(58)+Data.2pirdr(59);
I'm not sure if this is the logic you are looking for or you have something else in mind. You can easily separate the negative values from the positives values in two different tables and do all kind of operations there.
If you find this answer helpful please consider accepting it! Thanks
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!