Good, someone knows how to make an arrangement of chains, in which each element is read by keyboard. I have this but it does not work, I save the data in a 1xn matrix and each element is a 1x1 matrix, however, these elements are not accessed. What I'm trying to do is like a normal string vector in any other language, something like this in Java:
String [] V = new String [3]
V [0]="Hello";
System.out.println (V [0]);
This is my attempt at a solution in MatLab R2012b.
clc; clear all;
flag = 1;
sw = 1;
cont = 0;
connections = struct ([]);
while sw == 1
if (flag == 1)
n = input ('Type number of connections:');
flag = 0;
elseif cont < = n
cont = cont + 1;
connections (cont) .conexion = input ('Type connection (Format: FromHacia):', 's');
else
sw = 0;
end
end
% I try to read the first value entered with this
i = 0;
disp (connections (i) .connection)
% But I throw the following error
% Subscript indices must either be real positive integers or logicals.
% Error in WeShipCheap (line 19)
% disp (connections (i) .connection)