I try to create an array of strings
fruit = ['apple', 'cherry']
What modifications are needed so that fruit(2) is 'cherry' not 'p'?
UPDATE
Following the two first answers to this question I created a case:
style = {'.blue', '.red'};f1 = figure;for theta = (0:0.1:1)*pi for ind = 1:2 figure(f1); plot(theta, cos(theta + pi*ind), style(ind)); hold on; endend
The code does not accept style(ind) as an argument. The error message is
Error using plotInvalid first data argument
Best Answer