How can I import dataset in specific range
2 views (last 30 days)
Show older comments
Hello.
I am trying to import my csv file in specific range for example, from ith column to jth column and from kth row to nth row
I find a class to do this but it is not working correctly.
i=input('Enter a start row: ');
j=input('Enter a end row: ');
k=input('Enter a start column: ');
t=input('Enter a end column: ');
count=0;
search= importfiledataset('search-queries-features.csv',i,j);
[n,p]=size(search);
For example;
I enter values below but when i want to see 'search' p values is always 36. Briefly i need another way to read my csv file without 'importdataset' class
i=1
j=12
k=1
t=12
0 Comments
Accepted Answer
Ridwan Alam
on 17 Dec 2019
i=input('Enter a start row: ');
j=input('Enter a end row: ');
k=input('Enter a start column: ');
t=input('Enter a end column: ');
count=0;
search= csvread('search-queries-features.csv',i,k,[i,k,j,t]);
[n,p]=size(search);
more details: https://www.mathworks.com/help/matlab/ref/csvread.html
0 Comments
More Answers (0)
See Also
Categories
Find more on Data Import and Analysis 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!