How would I create a link to the excel file so you can see it? The excel file is simply one column of numbers by the way if you need that information.
Finding if the current data value is greater than the previous value
13 次查看(过去 30 天)
显示 更早的评论
I have formed a table of 1 column and many rows and I am trying to findout if the value in the current row is greater than the previous row but I am not sure where to start. I know I need to use for loops but I don't know how to use them here. Any ideas?
A= readtable ("GDF.xlsx");
for n=A
if...
Any help would be appreciated.
2 个评论
Torsten
2025-10-20
If it's simply one column of numbers, you can use the code from below.
If this doesn't work, use the INSERT > Attachments button from the menu bar to include the file.
采纳的回答
Torsten
2025-10-20
编辑:Torsten
2025-10-20
It would help if you include the GDF-file.
Without further information, I'd suggest
T = readtable ("GDF.xlsx");
A = table2array(T);
DA = all(diff(A) > 0)
If DA = 0, there are rows where the current row is smaller or equal than the previous row.
If DA = 1, the column is strictly increasing in value.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!