Counting values in a column
Mostra commenti meno recenti
Hello,
I have 2 columns in Excel that I would need to calculate in Matlab. In the first column I have a formula: =IF(J2=1;IF(ISNUMBER(K1);K1+1;1);0) In the second column: =IF(AND(J2=1;J3<>1);K2;0) After column J, I have it calculated in matlab. Thank you very much for the advice.
I created column J in matlab with the command: T.Platoon=double(T.CasRozdiel<=4). I have added a matlab file in the attachment.

How it looks in excel.

4 Commenti
Rik
il 23 Ago 2022
I think you need this structure in Matlab (with your array A and row n):
if A(n,1)==1 && A(n,+1,1)~=1
A(n,3)=A(n,2);
else
A(n,3)=0;
end
Is this what you mean?
Zuzana Pániková
il 23 Ago 2022
Modificato: Walter Roberson
il 23 Ago 2022
Image Analyst
il 24 Ago 2022
I'm not sure what you want. Why not simply read your existing Excel workbook in to MATLAB with readtable? The computed values (the numbers), not the formulas, are what should be read in. And since you did the computations in Excel, then numbers should be right.
Zuzana Pániková
il 24 Ago 2022
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Data Import from MATLAB in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
