Assigning values to a matrix
显示 更早的评论
I have a file called Height which I have imported into MATLAB and I am looking to see when the first value increases by 5
I would then like to assign 1 next to the point where the first value (of Height) increases by 5, or the 0 where it does not increase.
I also have a file for X and Y.
I would then like to combine the three files and the value for H into a matrix like the table below.

This is the code I have so far, but I only get a value of 1 instead of a value of 1 or 0 at the location where Height increased by 5.
Height = Height(1,:)
if Height > 5;
H = 1;
elseif Height < 5;
H = 0;
end;
If anyone has any ideas that would be greatly appreciated.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!