Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
matlab program

Subject: matlab program

From: Nsengimana Cyprien

Date: 9 Dec, 2012 10:20:11

Message: 1 of 2

Hello matlab users,does someone know how to solve this question?
I would need to make a program that can be able to read [filename.mat] with 48 rows of data observations with 6 columns.The program should be able to read two consecutives data lines(i.e two rows of data set) and jump the 3rd row everytime and continue to do so untill all data matrix of 48 rows and 6 columns are done.This will help me to separate data samples into two main groups .i.e 2 training data set and one validation data set continuously untill all data are finished to be read.

regards,
Cyprien

Subject: matlab program

From: dpb

Date: 9 Dec, 2012 15:55:01

Message: 2 of 2

On 12/9/2012 4:20 AM, Nsengimana Cyprien wrote:
> Hello matlab users,does someone know how to solve this question?
> I would need to make a program that can be able to read [filename.mat]
> with 48 rows of data observations with 6 columns.The program should be
> able to read two consecutives data lines(i.e two rows of data set) and
> jump the 3rd row everytime and continue to do so untill all data matrix
> of 48 rows and 6 columns are done.This will help me to separate data
> samples into two main groups .i.e 2 training data set and one validation
> data set continuously untill all data are finished to be read.

Much impler to just read the whole array and then delete the unwanted
rows...

x=textread('yourfile'); % Yes, deprecated but still easy and useful
x(3:3:end,:)=[];

--

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us