update vector data to start with a different value at specific point.
显示 更早的评论
Dear community, I'd like to ask your support to find a solution for below condition.
I have 6 vectors. time, CtTHiRes, HiResCalc, CtTgrdCalc, idx8 and TS_tClntEngOut
my goal is to calculate HiResCalc which it will have same values as CtTHiRes using CtTgrdCalc.
for ii = 2:N+1
if exist ('time')
HiResCalc(ii) = CtTgrdCalc(ii-1) + HiResCalc(ii-1);
end
I'm stuck trying to update HiResCalc.....
what I need to do is when idx8 = 0, HiResCalc should be updated and get whathever the valu is in TS_tClntEngOut, in this case the update happens at second 250 but it can be anyother time.
after HiResCalc is updated, calculation should continue as shonw in the script above but I don't know how to make it.....
for ia= 1:length(HiResCalc);
if idx8(ia) == 0
HiResCalc(ia,1) = TS_tClntEngOut(ia);
end
end
here is an image for your reffrence...

as before any feedback will be highly appreciated
3 个评论
Umar
2024-8-7
Hi @A-Rod,
Could you please share your full code, are you looking further to convert HiResCalc into HiResCalc.mat and so far you have five files storing variables in binary format. I will wait for your response.
A-Rod
2024-8-7
Umar
2024-8-7
Hi @Rod,
No problem, glad to help. Please don’t forget to vote for @Rajanya. Also, if you encounter any issues, please don’t hesitate to reach out to us for further assistance. Good luck!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!