update vector data to start with a different value at specific point.
Show older comments
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 Comments
Umar
on 7 Aug 2024
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
on 7 Aug 2024
Umar
on 7 Aug 2024
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!
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!