0
$\begingroup$

I have 4 signals: $z,c,d$ and $r$. $r$ is defined by: $r=[c,z,d,z]$

I would like to find signal $d$. In Matlab I do this:

r2=r(size(c,2)+size(z,2)+(0:size(d,2)-1))

Do we have $r2=d$?

$\endgroup$

closed as off-topic by Matt L., lennon310, MBaz, A_A, Stanley Pawlukiewicz Sep 15 '18 at 19:24

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "General programming questions are off-topic here, but can be asked on Stack Overflow." – Matt L., lennon310, MBaz, A_A, Stanley Pawlukiewicz
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ Have you tried running your code and seeing if it works? $\endgroup$ – MBaz Sep 11 '18 at 18:39
  • $\begingroup$ Don’t forget that Matlab has 1-based indexing $\endgroup$ – ThP Sep 12 '18 at 3:32
1
$\begingroup$

In case the four vectors are row vectors

r2=r(size(c,2)+size(z,2)+1:end-size(z,2))

In case the four vectors are column vectors

r2 = r(:,3)

PS: thanks @ThP

$\endgroup$
  • $\begingroup$ Unless they are row vectors $\endgroup$ – ThP Sep 12 '18 at 3:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.