Attempted to access X(1). Unable to acces because numel(X)=0
Show older comments
Hi,
I am trying to write a code that selects a portion of an array read from a .csv file by promptimg the user to input the first entry and last entry. But I get the error:
"Attempted to access X(1). Unable to acces because numel(X)=0"
And the full array is not formed. This is a portion of the code:
Y=xlsread('Book1.xlsx', 'a1:a500')
prompt = ' What is first? ';
f1 = input(prompt);
prompt= 'What is last number? ';
f2 = input(prompt);
y=[(Y(f1)):Y(f2))]
any ideas?
Accepted Answer
More Answers (0)
Categories
Find more on Whos 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!