Counting values in a column
Mostrar comentarios más antiguos
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 comentarios
Rik
el 23 de Ag. de 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á
el 23 de Ag. de 2022
Editada: Walter Roberson
el 23 de Ag. de 2022
Image Analyst
el 24 de Ag. de 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á
el 24 de Ag. de 2022
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Import from MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
