Writing and Executing Formula in Excel by MATLAB

조회 수: 20 (최근 30일)
Rounak Saha Niloy
Rounak Saha Niloy 2022년 3월 22일
댓글: Arif Hoq 2022년 3월 23일
I have some values in a xlx file in A1:A10 and B1:B10. If A1==B1, in C1, I want to write "Matched". How do I do this using MATLAB?

답변 (1개)

Arif Hoq
Arif Hoq 2022년 3월 23일
편집: Arif Hoq 2022년 3월 23일
My approach:
import the excel file into matlab >> Processing >> export into excel.
str={'Matched'};
A=readtable('example.xlsx','ReadVariableName',false);
if table2array(A(1,1))==table2array(A(1,2))
A(1,3)=str;
end
B=table2cell(A);
writecell(B,'example.xlsx') % export to same excel file, so that you can get the output in C1
  댓글 수: 2
Rounak Saha Niloy
Rounak Saha Niloy 2022년 3월 23일
Thanks
Arif Hoq
Arif Hoq 2022년 3월 23일
@Rounak Saha Niloy if you find my answer helpful, please mark this as an "Accepted answer"

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by