Finding the place where number is in a sequence and insert it in between that sequence

조회 수: 1 (최근 30일)
Suppose I have a sequence defined by a = [0:3:300]. Now I want to find where the number b = 44 comes in the sequence means in ascending order and then place the number b in that place. Initially b is not present in sequence a. I want it to be get it place found in ascending order and get it inserted in the sequence. Thanks in advance....!!

채택된 답변

dpb
dpb 2021년 7월 22일
in=find(b>a,1,"last");
a=[a(1:in) b a(in+1:end)];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by