How to convert R code to MATLAB?
조회 수: 2 (최근 30일)
이전 댓글 표시
HI. Anyone can help me with this R code? I need to convert in MATLAB code.
S2N <- function(A, C) { # computes robust signal to noise ratio for one gene
x <- split(A, C)
m1 <- mean(x[[1]])
m2 <- mean(x[[2]])
s1 <- ifelse(length(x[[1]]) > 1, sd(x[[1]]), 0)
s2 <- ifelse(length(x[[2]]) > 1, sd(x[[2]]), 0)
s1 <- ifelse(s1 < 0.1*abs(m1), 0.1*abs(m1), s1) # use 10% of the mean if the sd is zero or too low
s2 <- ifelse(s2 < 0.1*abs(m2), 0.1*abs(m2), s2)
s2n <- (m1 - m2)/(s1 + s2 + 0.1)
return(s2n)
}
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!