I have 3 strings like the following:
world=["America", "Europe"]; % Parent String
America=["USA", "Brazil", "Argentina"]; % Child1 String
Europe=["France", "Germany", "England"]; % Child2 String
I want to access the elements of the child string (Country names) from the Parent string(world) and use it inside a for loop for further operation. I am trying in the following way:
for i=1:2 d=world(i); % Temporary variable to store the continent name
for j=1:3disp(d(j)); % Throws an Error: "Index exceeds Matrix dimensions
endend
What am I doing wrong? Any help will be highly appreciated.
Best Answer