Counting values in a column
显示 更早的评论
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 个评论
Rik
2022-8-23
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á
2022-8-23
编辑:Walter Roberson
2022-8-23
Image Analyst
2022-8-24
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á
2022-8-24
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 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!
