Can someone help me convert this Rstudio code to Matlab?

t <- rep(seq(0,23.5,.5),11)
I really have no idea whats going on here since its in Rstudio, I think it has something to do with repeating a sequence!

Answers (1)

It seems to be documented in Generating regular sequences (link).
So:
t <- rep(seq(0,23.5,.5),11)
appears to be equivalent to:
t = repmat([0,23.5,.5], 1, 11);

2 Comments

I would think instead
t = repmat(0:.5:23.5, 1, 11);
I agree. (This is my first exposure to ‘R’.)

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

on 8 Feb 2018

Commented:

on 8 Feb 2018

Community Treasure Hunt

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

Start Hunting!