Is there a quick and easy way to insert/delete values into the middle or beginning of a cell array and/or a numerical array
이전 댓글 표시
I have a cell array and a numerical array. I want to insert values into the beggining, middle and end of the cell array or the numerical array. Is there an easy way to do this.
I also want to be able to delete array elements at the beginning, middle or end of the arrays. Same question...
채택된 답변
추가 답변 (1개)
madhan ravi
2018년 12월 16일
편집: madhan ravi
2018년 12월 16일
a=1:11;
a(1) = somevalue%first element [] square bracket removes that element
a(fix(mean(a))) %mid element
a(end) % last element
댓글 수: 4
Robert Garneau
2018년 12월 16일
madhan ravi
2018년 12월 16일
I am having trouble understanding you please give an example.
Robert Garneau
2018년 12월 16일
Stephen23
2018년 12월 17일
"is there an easier way to do it using MATLAB Functions/abilities."
Not really. Indexing is the easiest way.
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!