Writing and Executing Formula in Excel by MATLAB

27 vues (au cours des 30 derniers jours)
Rounak Saha Niloy
Rounak Saha Niloy le 22 Mar 2022
Commenté : Arif Hoq le 23 Mar 2022
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?

Réponses (1)

Arif Hoq
Arif Hoq le 23 Mar 2022
Modifié(e) : Arif Hoq le 23 Mar 2022
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 commentaires
Rounak Saha Niloy
Rounak Saha Niloy le 23 Mar 2022
Thanks
Arif Hoq
Arif Hoq le 23 Mar 2022
@Rounak Saha Niloy if you find my answer helpful, please mark this as an "Accepted answer"

Connectez-vous pour commenter.

Catégories

En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by