« first day (2557 days earlier)      last day (663 days later) » 

 
3 hours later…
8:49 AM
I want to store strings like a+, b+, c+ in an array in MATLAB
not sure how to do it..I have tried
x = [];
for i =1:n
x(i) = 'a+';
end
but this returns error
..............................................................
like
for i = 1:10
x = 'a+';
y = 'a-';
z = 'b+';
v(i) = [x y z];
end
v
doesnot work
 
 
2 hours later…
11:13 AM
@BAYMAX If you really want strings (as opposed to char vectors), replace single quotes by double quotes in your code, and don't initialize x as []. If you want char vectors, just replace (i) by {i} in your current code to create a cell array of char vectors
 
 
3 hours later…
2:17 PM
@BAYMAX 'a+' is an array with two characters, you cannot put it into a single array element. "a+" is a single string, that does fit in a single array element. But it has to be a string array and not a double array.
 
 
1 hour later…
3:34 PM
@CrisLuengo Those red lights help set the mood with the Imperial March (0:50) :-)
 

« first day (2557 days earlier)      last day (663 days later) »