본문 바로가기

전체 글227

외부 데이터(파일) 불러오기와 저장하기 그래프를 그리고 싶은데, 데이터가 txt파일이다. 붙여넣기는 너무 많고.... 텍스트 파일은 100개가 넘는데 일일이 어떻게 다 붙이니 난 한번만이라도 햄보카고 싶은데 왜 나나 꽈찌쭈는 햄보칼수가 없어 에라이 매트랩 안써 이런 개같은 경우 이런 식의 문제가 있었다면 이젠 그 고민 말끔하게 해결해 드리겠습니다. 오늘은 외부 데이터 파일을 불러와서 매트랩에 입력하는 방법과 또 매트랩에서 처리한 데이터를 다시 출력해서 저장하는 것을 해보도록 하겠습니다. 1. 데이터가 알흠답구나. load를 쓰자. load라는 명령어는 외부 데이터에 주석따위 없이 참으로 간단 명료하게 데이터만 딱딱 나와 있을 때 쓰기 딱 좋습니다. (오우 롸임이 끝내주는걸) 예를들면 1.txt란 파일에 요런 데이터가 있다고 합시다: 다운은 하.. 2014. 12. 19.
randperm 함수 randperm Random permutationSyntax p = randperm(n) Description p = randperm(n) returns a random permutation of the integers 1:n.Remarks The randperm function calls rand and therefore changes rand's state.Examples randperm(6) might be the vector[3 2 6 4 1 5]or it might be some other permutation of 1:6. 말 그대로 랜덤으로 순열을 만드는 함수 이다. v = randperm(5) v 2 4 1 3 5 위와 같이 나올 수 있다. 2014. 12. 19.
cellfun 함수 cellfun Apply function to each cell in cell array------------------------------------------------------------------------------------------------------------------------------------내가 알고 싶었던 것은ims = cellfun(@(x)fullfile(classes{ci},x),{ims.name},'UniformOutput',false) ; 이것이 어떻게 해석이 되는 것일까...?---------------------------------------------------------------------------------------------------------.. 2014. 12. 19.
sub2ind 함수 인터넷에서 sub2ind함수를 찾아봤다 sub2ind Single index from subscripts 서브크르립트의 싱글인덱스 Syntax IND = sub2ind(siz,I,J) IND = sub2ind(siz,I1,I2,...,In) Description The sub2ind command determines the equivalent single index corresponding to a set of subscript values. IND = sub2ind(siz,I,J) returns the linear index equivalent to the row and column subscripts I and J for a matrix of size siz. IND = sub2ind(siz,I1,I.. 2014. 12. 19.
반응형