How to convert R code to MATLAB?

조회 수: 2 (최근 30일)
noramalina mohd hatta
noramalina mohd hatta 2016년 3월 18일
편집: Stephen23 2016년 3월 18일
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개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by