How do I analyse an array of strings?

2 views (last 30 days)
Amala Putrevu
Amala Putrevu on 11 Jul 2014
Commented: Amala Putrevu on 14 Jul 2014
I have imported data into the program and need to analyse and simplify it. Within that, I have an array of strings that correspond to the calibration type. I need to write a function that checks where the calibration changes and display the corresponding time. I tried using strcmp but to no avail. How can I iterate over an array of strings?
  4 Comments
Amala Putrevu
Amala Putrevu on 14 Jul 2014
I have the strings stored as a column of a matrix of a structure.
The looping code is:
SWCal = [];
for i=StartFile:EndFile
if i_SWCal>0
i_SWCal = [SWCal; UD.Truck(iT).DataBasic(i).HistVal(:,i_SWCal)];
end
I need to check where the Calibration changes. I tried with a cell initialisation as well but it is not looping the strings. I checked this in the workspace.
Amala Putrevu
Amala Putrevu on 14 Jul 2014
The other loops are all for numeric values, for example:
VehSpeed = [];
for i=StartFile:EndFile
if i_VS>0
VehSpeed = [VehSpeed;UD.Truck(iT).DataBasic(i).HistVal(:,i_VS)];
I am not understanding how to change the initialisation and the looping command for the column of strings.

Sign in to comment.

Answers (0)

Categories

Find more on Structures in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!