How can I import dataset in specific range

2 views (last 30 days)
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

Accepted Answer

Ridwan Alam
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 Answers (0)

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!