게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
매트랩 고수님들 도와주세요!!
게시물ID : jisik_113548짧은주소 복사하기
작성자 : 체리맛미역
추천 : 0
조회수 : 369회
댓글수 : 1개
등록시간 : 2011/11/30 04:52:41
Modify the ssort 에프unction developed in the class so that it accepts a second input argument,
which is either ascending or descending. If argument is “up”, sort the data in ascending order.
If the argument is “down”, sort the data in the descending order. If the argument is missing,
the default case is to sort the data in ascending order.

>> arr=[1 -5 6 23 230 3];
>> ssort1_lastName_firstName(arr,'up')
ans =
-5 1 3 6 23 230
>> ssort1_lastName_firstName(arr,'down')
ans =
230 23 6 3 1 -5
>> ssort1_lastName_firstName(arr)
ans =
-5 1 3 6 23 230

이게 과제인데 ㅠㅠ

아무리 찾아보고 공부해봐도

ssort1_lastName_firstName(arr)

이것은 알겠는데

ssort1_lastName_firstName(arr, 'up')

이거 때문에 오류가 나는거 같아요 ㅠㅠ

그러니깐

에프unction Y = ssort1_hong_sungho1(arr,'문자') <-- 문자때문에 오류가는거 같은데 해결 방법좀 알려주세요

아 ㅠㅠ 도와주세요 ㅠㅠ


전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호