형변환
num2str()
리스트 안에 있는지?
strcmp(a,list_b)
잠시 대기
pause(1)
프린트 함수
디스플레이 : 일반 문자열 1개 디스플레이
disp(str)
fprintf('hello \n') : file print formatted
sprintf('hello') : string print formatted
find 함수
find(리스트) : 0이 아닌 리스트의 자리값을 알려줌
반복문 : a를 1부터 1만큼 10까지
for a = 1 : 1 : 10
end
while 조건
내용
end
조건문 :
if socre > 70
disp('good')
elseif score > 60
disp('not good')
end
switch 변수
case 변수조건
내용
case 변수조건
내용
otherwise
내용
end
파일입출력
fileID = fopen('file.txt','w')
안에 들어갈 내용
fclose(fileID)
반응형
'컴퓨터공학3학년 > MATLAB' 카테고리의 다른 글
[MATLAB] 3x3 행렬에서 한 행을 삭제하기 (0) | 2021.04.20 |
---|---|
[MATLAB] 23이하의 소수 행렬을 만들어 3x3 행렬로 만들기 (0) | 2021.04.20 |
[MATLAB] 기초3 (0) | 2021.03.01 |
[MATLAB] 기초2 (0) | 2021.03.01 |
[MATLAB] 기초1 (0) | 2021.03.01 |