Index . 블로그창고 . Any comments?

\cat programming

Creating a matrix with repeating elements
Removing NaNs from data
Serializing a matrix
Creating a matrix from a vector

Creating a matrix with repeating elements

repmat(X, m, n);

Removing NaNs from data

http://www.mathworks.com/access/helpdesk_r13/help/techdoc/math_anal/datafun7.html

Find indices of elements in vector that are not NaNs, then keep only the non-NaN elements.

i = find(~isnan(x));
x = x(i);

Remove NaNs from vector.

x = x(find(~isnan(x)))

Remove NaNs from vector (faster).

x = x(~isnan(x));

Remove NaNs from vector.

x(isnan(x)) = [];

Remove any rows of matrix X containing NaNs.

X(any(isnan(X)'),:) = [];

Serializing a matrix

X(:);

Creating a matrix from a vector

reshape(x, m, n);

All the works in this site except software and copyrighted materials by others (e.g., 문학) are licensed under a Creative Commons License. 소프트웨어 및 문학과 같이 다른 이에게 저작권이 있는 작품을 제외하고 모두 크리에이티브 커먼즈 라이센스를 따른다.
Mon Mar 25 01:33:30 2024 . XHTML . CSS (lightbox.css is not part of Uniqki. ;-) . Powered by Uniqki!
refresh . edit . loginout . index